mirror of https://github.com/OpenTTD/OpenTTD
(svn r19599) -Fix [FS#3751]: Vehicles with a weight of zero crashed the game when using realistic acceleration.
parent
d308a41cef
commit
c233dc08c1
|
@ -80,7 +80,7 @@ void GroundVehicle<T, Type>::CargoChanged()
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Store consist weight in cache. */
|
/* Store consist weight in cache. */
|
||||||
this->acc_cache.cached_weight = weight;
|
this->acc_cache.cached_weight = max<uint32>(1, weight);
|
||||||
|
|
||||||
/* Now update vehicle power (tractive effort is dependent on weight). */
|
/* Now update vehicle power (tractive effort is dependent on weight). */
|
||||||
this->PowerChanged();
|
this->PowerChanged();
|
||||||
|
|
Loading…
Reference in New Issue