diff options
-rw-r--r-- | src/newgrf_engine.cpp | 2 | ||||
-rw-r--r-- | src/train_cmd.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/newgrf_engine.cpp b/src/newgrf_engine.cpp index e57410224..ee4af5e6a 100644 --- a/src/newgrf_engine.cpp +++ b/src/newgrf_engine.cpp @@ -1189,7 +1189,7 @@ int GetEngineProperty(EngineID engine, PropertyID property, int orig_value, cons if (callback != CALLBACK_FAILED) { if (is_signed) { /* Sign extend 15 bit integer */ - return static_cast<int16>(callback << 1) >> 1; + return static_cast<int16>(callback << 1) / 2; } else { return callback; } diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index 1498a5fad..f926be637 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -363,7 +363,7 @@ int Train::GetCurveSpeedLimit() const /* Apply max_speed modifier (cached value is fixed-point binary with 8 fractional bits) * and clamp the result to an acceptable range. */ - max_speed += (max_speed * this->tcache.cached_curve_speed_mod) >> 8; + max_speed += (max_speed * this->tcache.cached_curve_speed_mod) / 256; max_speed = Clamp(max_speed, 2, absolute_max_speed); } |