forked from mirror/OpenTTD
(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)
This commit is contained in:
6
engine.c
6
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;
|
||||
|
||||
|
Reference in New Issue
Block a user