Changeset - r16532:33a2daed770f
[Not reviewed]
master
0 1 0
rubidium - 14 years ago 2010-11-20 13:57:49
rubidium@openttd.org
(svn r21268) -Fix (r21266): crash (or rather a triggered assertion) in some cases
1 file changed with 6 insertions and 5 deletions:
0 comments (0 inline, 0 general)
src/station_cmd.cpp
Show inline comments
 
@@ -1413,6 +1413,12 @@ CommandCost RemoveFromRailBaseStation(Ti
 
		/* If we reached here, the tile is valid so increase the quantity of tiles we will remove */
 
		quantity++;
 

	
 
		if (keep_rail || IsStationTileBlocked(tile)) {
 
			/* Don't refund the 'steel' of the track when we keep the
 
			 *  rail, or when the tile didn't have any rail at all. */
 
			total_cost.AddCost(-_price[PR_CLEAR_RAIL]);
 
		}
 

	
 
		if (flags & DC_EXEC) {
 
			/* read variables before the station tile is removed */
 
			uint specindex = GetCustomStationSpecIndex(tile);
 
@@ -1455,11 +1461,6 @@ CommandCost RemoveFromRailBaseStation(Ti
 
				if (IsRailStationTile(v->tile)) SetRailStationPlatformReservation(v->tile, TrackdirToExitdir(ReverseTrackdir(v->GetVehicleTrackdir())), true);
 
			}
 
		}
 
		if (keep_rail || IsStationTileBlocked(tile)) {
 
			/* Don't refund the 'steel' of the track when we keep the
 
			 *  rail, or when the tile didn't have any rail at all. */
 
			total_cost.AddCost(-_price[PR_CLEAR_RAIL]);
 
		}
 
	}
 

	
 
	if (quantity == 0) return_cmd_error(STR_ERROR_THERE_IS_NO_STATION);
0 comments (0 inline, 0 general)