Changeset - r5850:f8b42888e218
[Not reviewed]
master
0 1 0
tron - 18 years ago 2007-01-26 20:49:40
tron@openttd.org
(svn r8424) -Fix

Do not call ClearSlot() just before calling DeleteVehicle(), which does it too
1 file changed with 0 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/roadveh_cmd.cpp
Show inline comments
 
@@ -274,25 +274,24 @@ int32 CmdSellRoadVeh(TileIndex tile, uin
 
	SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES);
 

	
 
	if (!IsRoadVehInDepotStopped(v)) {
 
		return_cmd_error(STR_9013_MUST_BE_STOPPED_INSIDE);
 
	}
 

	
 
	if (flags & DC_EXEC) {
 
		// Invalidate depot
 
		InvalidateWindow(WC_VEHICLE_DEPOT, v->tile);
 
		RebuildVehicleLists();
 
		InvalidateWindow(WC_COMPANY, v->owner);
 
		DeleteWindowById(WC_VEHICLE_VIEW, v->index);
 
		ClearSlot(v);
 
		DeleteDepotHighlightOfVehicle(v);
 
		DeleteVehicle(v);
 
		if (IsLocalPlayer()) InvalidateWindow(WC_REPLACE_VEHICLE, VEH_Road);
 
	}
 

	
 
	return -(int32)v->value;
 
}
 

	
 
typedef struct RoadFindDepotData {
 
	uint best_length;
 
	TileIndex tile;
 
	OwnerByte owner;
 
@@ -503,25 +502,24 @@ static void RoadVehDelete(Vehicle *v)
 
{
 
	DeleteWindowById(WC_VEHICLE_VIEW, v->index);
 
	InvalidateWindow(WC_VEHICLE_DETAILS, v->index);
 

	
 
	RebuildVehicleLists();
 
	InvalidateWindow(WC_COMPANY, v->owner);
 

	
 
	if (IsTileType(v->tile, MP_STATION)) ClearCrashedStation(v);
 

	
 
	BeginVehicleMove(v);
 
	EndVehicleMove(v);
 

	
 
	ClearSlot(v);
 
	DeleteVehicle(v);
 
}
 

	
 
static byte SetRoadVehPosition(Vehicle *v, int x, int y)
 
{
 
	byte new_z, old_z;
 

	
 
	// need this hint so it returns the right z coordinate on bridges.
 
	v->x_pos = x;
 
	v->y_pos = y;
 
	new_z = GetSlopeZ(x, y);
 

	
0 comments (0 inline, 0 general)