(svn r17443) -Fix (r17442): clear the depot tile after removing the depot in all cases instead of only for ships; makes removing road/rail depots not crash :)

pull/155/head
rubidium 15 years ago
parent 6bdef071d6
commit 389e1bdfbe

@ -1442,8 +1442,8 @@ static CommandCost RemoveTrainDepot(TileIndex tile, DoCommandFlag flags)
if (v != NULL) FreeTrainTrackReservation(v);
}
DoClearSquare(tile);
delete Depot::GetByTile(tile);
DoClearSquare(tile);
AddSideToSignalBuffer(tile, dir, owner);
YapfNotifyTrackLayoutChange(tile, DiagDirToDiagTrack(dir));
if (v != NULL) TryPathReserve(v, true);

@ -895,8 +895,8 @@ static CommandCost RemoveRoadDepot(TileIndex tile, DoCommandFlag flags)
if (!EnsureNoVehicleOnGround(tile)) return CMD_ERROR;
if (flags & DC_EXEC) {
DoClearSquare(tile);
delete Depot::GetByTile(tile);
DoClearSquare(tile);
}
return CommandCost(EXPENSES_CONSTRUCTION, _price.remove_road_depot);

Loading…
Cancel
Save