Fix various compiler warnings

See: #267
This commit is contained in:
Jonathan G Rennison
2021-06-11 22:54:27 +01:00
parent 97d5982cb5
commit 1002c6d9d2
46 changed files with 101 additions and 101 deletions

View File

@@ -261,7 +261,7 @@ GroundVehicleAcceleration GroundVehicle<T, Type>::GetAcceleration()
breakdown_factor /= (Train::From(this)->tcache.cached_num_engines + 2);
}
/* breakdown_chance is at least 5 (5 / 128 = ~4% of the normal chance) */
this->breakdown_chance_factor = std::max(breakdown_factor >> 16, (uint64)5);
this->breakdown_chance_factor = Clamp<uint64>(breakdown_factor >> 16, 5, 255);
}
int braking_accel;