Fix various possible integer type conversion issues

This commit is contained in:
Jonathan G Rennison
2023-02-15 23:05:03 +00:00
parent 7c1d2bef0e
commit 8d6e57799c
9 changed files with 16 additions and 11 deletions

View File

@@ -7319,7 +7319,7 @@ int GetTrainRealisticAccelerationAtSpeed(const int speed, const int mass, const
if (!maglev) {
/* Static resistance plus rolling friction. */
resistance = 10 * mass;
resistance += mass * (15 * (512 + speed) / 512);
resistance += (int64)mass * (int64)(15 * (512 + speed) / 512);
}
const int area = 14;