From 682b9ee8e4e594b4737528ff769bbe526aee2f8e Mon Sep 17 00:00:00 2001 From: bjarni Date: Mon, 31 Oct 2005 12:59:47 +0000 Subject: (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) --- vehicle.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'vehicle.h') diff --git a/vehicle.h b/vehicle.h index ef0646b5f..b1d3d81fe 100644 --- a/vehicle.h +++ b/vehicle.h @@ -153,6 +153,7 @@ struct Vehicle { Vehicle *next; // next Vehicle *first; // NOSAVE: pointer to the first vehicle in the chain + Vehicle *depot_list; //NOSAVE: linked list to tell what vehicles entered a depot during the last tick. Used by autoreplace StringID string_id; // Displayed string @@ -164,6 +165,7 @@ struct Vehicle { int32 x_pos; // coordinates int32 y_pos; + byte z_pos; byte direction; // facing @@ -240,6 +242,8 @@ struct Vehicle { int32 profit_last_year; uint32 value; + + union { VehicleRail rail; VehicleAir air; @@ -309,7 +313,7 @@ Vehicle *CheckClickOnVehicle(const ViewPort *vp, int x, int y); void DecreaseVehicleValue(Vehicle *v); void CheckVehicleBreakdown(Vehicle *v); void AgeVehicle(Vehicle *v); -Vehicle * MaybeReplaceVehicle(Vehicle *v); +void VehicleEnteredDepotThisTick(Vehicle *v); void BeginVehicleMove(Vehicle *v); void EndVehicleMove(Vehicle *v); -- cgit v1.2.3-54-g00ecf