summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordarkvater <darkvater@openttd.org>2005-01-24 00:36:22 +0000
committerdarkvater <darkvater@openttd.org>2005-01-24 00:36:22 +0000
commita9e789fa021b842f84a06afa7b280877a4c20be9 (patch)
tree7aea82c039f2aa2fc6a054e7b6b76230b9fc2a87
parent590bbd7e21aa10669c22464a25a65599ce865dc3 (diff)
downloadopenttd-a9e789fa021b842f84a06afa7b280877a4c20be9.tar.xz
(svn r1633) -Fix: [1040119] Flood and wagons in depot
-rw-r--r--train_cmd.c4
-rw-r--r--water_cmd.c2
2 files changed, 5 insertions, 1 deletions
diff --git a/train_cmd.c b/train_cmd.c
index c871764d1..81f85e9ae 100644
--- a/train_cmd.c
+++ b/train_cmd.c
@@ -2630,6 +2630,10 @@ void Train_Tick(Vehicle *v)
// make sure vehicle wasn't deleted.
if (v->type == VEH_Train && v->subtype == TS_Front_Engine)
TrainLocoHandler(v, true);
+ } else if (v->subtype == TS_Free_Car && HASBITS(v->vehstatus, VS_CRASHED)) {
+ // Delete flooded standalone wagon
+ if (++v->u.rail.crash_anim_pos >= 4400)
+ DeleteVehicle(v);
}
}
diff --git a/water_cmd.c b/water_cmd.c
index 2cfa8fa6d..dfa7bd6cb 100644
--- a/water_cmd.c
+++ b/water_cmd.c
@@ -587,7 +587,7 @@ static void FloodVehicle(Vehicle *v)
else if (v->type == VEH_Train) {
v = GetFirstVehicleInChain(v);
u = v;
- pass = 4; // driver
+ if (v->subtype == TS_Front_Engine) pass = 4; // driver
// crash all wagons, and count passangers
BEGIN_ENUM_WAGONS(v)