Changeset - r13518:bfdf0ce07a12
[Not reviewed]
master
0 1 0
rubidium - 15 years ago 2009-11-12 17:28:20
rubidium@openttd.org
(svn r18049) -Fix [FS#3310] (r16448): Crash when an articulated RV is turning on a drive through road station that gets forcefully (bankrupt) removed
1 file changed with 10 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/station_cmd.cpp
Show inline comments
 
@@ -1640,25 +1640,34 @@ CommandCost CmdBuildRoadStop(TileIndex t
 
		UpdateStationAcceptance(st, false);
 
		st->RecomputeIndustriesNear();
 
		InvalidateWindowData(WC_SELECT_STATION, 0, 0);
 
		InvalidateWindowData(WC_STATION_LIST, st->owner, 0);
 
		SetWindowWidgetDirty(WC_STATION_VIEW, st->index, SVW_ROADVEHS);
 
	}
 
	return cost;
 
}
 

	
 

	
 
static Vehicle *ClearRoadStopStatusEnum(Vehicle *v, void *)
 
{
 
	if (v->type == VEH_ROAD) RoadVehicle::From(v)->state &= RVSB_ROAD_STOP_TRACKDIR_MASK;
 
	if (v->type == VEH_ROAD) {
 
		/* Okay... we are a road vehicle on a drive through road stop.
 
		 * But that road stop has just been removed, so we need to make
 
		 * sure we are in a valid state... however, vehicles can also
 
		 * turn on road stop tiles, so only clear the 'road stop' state
 
		 * bits and only when the state was 'in road stop', otherwise
 
		 * we'll end up clearing the turn around bits. */
 
		RoadVehicle *rv = RoadVehicle::From(v);
 
		if (HasBit(rv->state, RVS_IN_DT_ROAD_STOP)) rv->state &= RVSB_ROAD_STOP_TRACKDIR_MASK;
 
	}
 

	
 
	return NULL;
 
}
 

	
 

	
 
/**
 
 * Remove a bus station/truck stop
 
 * @param tile TileIndex been queried
 
 * @param flags operation to perform
 
 * @return cost or failure of operation
 
 */
 
static CommandCost RemoveRoadStop(TileIndex tile, DoCommandFlag flags)
0 comments (0 inline, 0 general)