summaryrefslogtreecommitdiff
path: root/src/vehicle.cpp
diff options
context:
space:
mode:
authorterkhen <terkhen@openttd.org>2010-06-11 20:30:12 +0000
committerterkhen <terkhen@openttd.org>2010-06-11 20:30:12 +0000
commit3287f9189355f71d55a473096e94dfed4d108cb3 (patch)
tree6ad72bcded21e1b950324315d3d6a36a53429bee /src/vehicle.cpp
parenta345711a897dec9bf965e33a1b7a61c7b6cd8194 (diff)
downloadopenttd-3287f9189355f71d55a473096e94dfed4d108cb3.tar.xz
(svn r19963) -Add: Stop a vehicle after it crashes or is destroyed.
Diffstat (limited to 'src/vehicle.cpp')
-rw-r--r--src/vehicle.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp
index 7e97c465f..0c0e33a59 100644
--- a/src/vehicle.cpp
+++ b/src/vehicle.cpp
@@ -169,6 +169,8 @@ uint Vehicle::Crash(bool flooded)
assert(this->Previous() == NULL); // IsPrimaryVehicle fails for free-wagon-chains
uint pass = 0;
+ /* Stop the vehicle. */
+ if (this->IsPrimaryVehicle()) this->vehstatus |= VS_STOPPED;
/* crash all wagons, and count passengers */
for (Vehicle *v = this; v != NULL; v = v->Next()) {
if (IsCargoInClass(v->cargo_type, CC_PASSENGERS)) pass += v->cargo.Count();