summaryrefslogtreecommitdiff
path: root/engine.c
diff options
context:
space:
mode:
authorbjarni <bjarni@openttd.org>2005-10-31 12:59:47 +0000
committerbjarni <bjarni@openttd.org>2005-10-31 12:59:47 +0000
commit682b9ee8e4e594b4737528ff769bbe526aee2f8e (patch)
tree27e67e4ab96bd9ad2c2eea8092cd15b2d09de93c /engine.c
parent95d1c43565402743d5cf6f215886ba028a54bb93 (diff)
downloadopenttd-682b9ee8e4e594b4737528ff769bbe526aee2f8e.tar.xz
(svn r3111) -Fix: [autoreplace] [ 1341783 ] Assertion failure in vehicle.c line 378
running MaybeReplaceVehicle() is now delayed until after the loop in CallVehicleTicks() This avoids selling the vehicle the loop currently works with (and continues to work with afterwards)
Diffstat (limited to 'engine.c')
-rw-r--r--engine.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/engine.c b/engine.c
index acb4df082..df0a16308 100644
--- a/engine.c
+++ b/engine.c
@@ -718,6 +718,12 @@ static void DoTriggerVehicle(Vehicle *veh, VehicleTrigger trigger, byte base_ran
(resolve_callback) TriggerVehicleSpriteGroup);
}
+ if (trigger == VEHICLE_TRIGGER_DEPOT) {
+ // store that the vehicle entered a depot this tick
+ // it needs to be before all possible return statements;
+ VehicleEnteredDepotThisTick(veh);
+ }
+
if (group == NULL)
return;