(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:
bjarni
2005-10-31 12:59:47 +00:00
parent 95d1c43565
commit 682b9ee8e4
7 changed files with 54 additions and 17 deletions

View File

@@ -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;