mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-15 08:22:34 +01:00
Codefix: potential integer overflow before widening integer
This commit is contained in:
@@ -110,7 +110,7 @@ int GroundVehicle<T, Type>::GetAcceleration() const
|
||||
int64_t speed = v->GetCurrentSpeed(); // [km/h-ish]
|
||||
|
||||
/* Weight is stored in tonnes. */
|
||||
int32_t mass = this->gcache.cached_weight;
|
||||
int64_t mass = this->gcache.cached_weight;
|
||||
|
||||
/* Power is stored in HP, we need it in watts.
|
||||
* Each vehicle can have U16 power, 128 vehicles, HP -> watt
|
||||
|
||||
Reference in New Issue
Block a user