summaryrefslogtreecommitdiff
path: root/src/vehicle.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2012-05-09 19:11:09 +0000
committerrubidium <rubidium@openttd.org>2012-05-09 19:11:09 +0000
commit5bfed864a08dce717e2658786948e6659872b8d4 (patch)
tree8710031cb4842cf8dcf872ee398b0ddf14966850 /src/vehicle.cpp
parent334c0e897c60205542c7163d39c605241e49a2fd (diff)
downloadopenttd-5bfed864a08dce717e2658786948e6659872b8d4.tar.xz
(svn r24219) -Fix [FS#5152]: immediately do the cargo payment on vehicle crashes instead of when they are cleared
Diffstat (limited to 'src/vehicle.cpp')
-rw-r--r--src/vehicle.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp
index bbc370b7a..1513837b3 100644
--- a/src/vehicle.cpp
+++ b/src/vehicle.cpp
@@ -200,6 +200,9 @@ uint Vehicle::Crash(bool flooded)
SetWindowDirty(WC_VEHICLE_DETAILS, this->index);
SetWindowDirty(WC_VEHICLE_DEPOT, this->tile);
+ delete this->cargo_payment;
+ this->cargo_payment = NULL;
+
return RandomRange(pass + 1); // Randomise deceased passengers.
}