From c233dc08c148792eddd7b219ff17bb0f7223a8b0 Mon Sep 17 00:00:00 2001 From: terkhen Date: Sat, 10 Apr 2010 19:30:38 +0000 Subject: (svn r19599) -Fix [FS#3751]: Vehicles with a weight of zero crashed the game when using realistic acceleration. --- src/ground_vehicle.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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::CargoChanged() } /* Store consist weight in cache. */ - this->acc_cache.cached_weight = weight; + this->acc_cache.cached_weight = max(1, weight); /* Now update vehicle power (tractive effort is dependent on weight). */ this->PowerChanged(); -- cgit v1.2.3-54-g00ecf