summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorterkhen <terkhen@openttd.org>2010-04-10 19:30:38 +0000
committerterkhen <terkhen@openttd.org>2010-04-10 19:30:38 +0000
commitc233dc08c148792eddd7b219ff17bb0f7223a8b0 (patch)
tree8f27a534fe5be9748bbf22bff716502e550a8c59 /src
parentd308a41cef7fce43fea7a41e731233febcd7fa8c (diff)
downloadopenttd-c233dc08c148792eddd7b219ff17bb0f7223a8b0.tar.xz
(svn r19599) -Fix [FS#3751]: Vehicles with a weight of zero crashed the game when using realistic acceleration.
Diffstat (limited to 'src')
-rw-r--r--src/ground_vehicle.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ground_vehicle.cpp b/src/ground_vehicle.cpp
index 419d9483b..395f0c26b 100644
--- a/src/ground_vehicle.cpp
+++ b/src/ground_vehicle.cpp
@@ -80,7 +80,7 @@ void GroundVehicle<T, Type>::CargoChanged()
}
/* 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). */
this->PowerChanged();