Changeset - r14354:83c45130f3ef
[Not reviewed]
master
0 3 0
yexo - 15 years ago 2010-01-26 23:03:47
yexo@openttd.org
(svn r18921) -Codechange: make the preconditions for Get/Set CustomStationSpecIndex a bit more strict
3 files changed with 4 insertions and 4 deletions:
0 comments (0 inline, 0 general)
src/station_cmd.cpp
Show inline comments
 
@@ -1121,7 +1121,7 @@ CommandCost CmdBuildRailStation(TileInde
 

	
 
				/* Remove animation if overbuilding */
 
				DeleteAnimatedTile(tile);
 
				byte old_specindex = IsTileType(tile, MP_STATION) ? GetCustomStationSpecIndex(tile) : 0;
 
				byte old_specindex = HasStationTileRail(tile) ? GetCustomStationSpecIndex(tile) : 0;
 
				MakeRailStation(tile, st->owner, st->index, axis, layout & ~1, rt);
 
				/* Free the spec if we overbuild something */
 
				DeallocateSpecFromStation(st, old_specindex);
src/station_map.h
Show inline comments
 
@@ -407,13 +407,13 @@ static inline bool IsCustomStationSpecIn
 

	
 
static inline void SetCustomStationSpecIndex(TileIndex t, byte specindex)
 
{
 
	assert(IsTileType(t, MP_STATION));
 
	assert(HasStationTileRail(t));
 
	_m[t].m4 = specindex;
 
}
 

	
 
static inline uint GetCustomStationSpecIndex(TileIndex t)
 
{
 
	assert(IsTileType(t, MP_STATION));
 
	assert(HasStationTileRail(t));
 
	return _m[t].m4;
 
}
 

	
src/waypoint_cmd.cpp
Show inline comments
 
@@ -306,7 +306,7 @@ CommandCost CmdBuildRailWaypoint(TileInd
 

	
 
		for (int i = 0; i < count; i++) {
 
			TileIndex tile = start_tile + i * offset;
 
			byte old_specindex = IsTileType(tile, MP_STATION) ? GetCustomStationSpecIndex(tile) : 0;
 
			byte old_specindex = HasStationTileRail(tile) ? GetCustomStationSpecIndex(tile) : 0;
 
			bool reserved = IsTileType(tile, MP_RAILWAY) ?
 
					HasBit(GetRailReservationTrackBits(tile), AxisToTrack(axis)) :
 
					HasStationReservation(tile);
0 comments (0 inline, 0 general)