Changeset - r3191:083ecd2ce7fd
[Not reviewed]
master
0 2 0
tron - 19 years ago 2006-03-13 20:12:35
tron@openttd.org
(svn r3851) Rail depots only have an entrance at one side, therefore use UpdateSignalsOnSegment() instead of SetSignalsOnBothDir()
2 files changed with 4 insertions and 7 deletions:
0 comments (0 inline, 0 general)
rail_cmd.c
Show inline comments
 
@@ -662,13 +662,13 @@ int32 CmdBuildTrainDepot(int x, int y, u
 
		MakeRailDepot(tile, _current_player, p2, p1);
 
		MarkTileDirtyByTile(tile);
 

	
 
		d->xy = tile;
 
		d->town_index = ClosestTownFromTile(tile, (uint)-1)->index;
 

	
 
		SetSignalsOnBothDir(tile, (p2 & 1) ? 2 : 1);
 
		UpdateSignalsOnSegment(tile, p2);
 
	}
 

	
 
	return cost + _price.build_train_depot;
 
}
 

	
 
/** Build signals, alternate between double/single, signal/semaphore,
 
@@ -1020,16 +1020,16 @@ static int32 RemoveTrainDepot(TileIndex 
 
		return CMD_ERROR;
 

	
 
	if (!EnsureNoVehicle(tile))
 
		return CMD_ERROR;
 

	
 
	if (flags & DC_EXEC) {
 
		Track track = TrackdirToTrack(DiagdirToDiagTrackdir(GetRailDepotDirection(tile)));
 
		DiagDirection dir = GetRailDepotDirection(tile);
 

	
 
		DoDeleteDepot(tile);
 
		SetSignalsOnBothDir(tile, track);
 
		UpdateSignalsOnSegment(tile, dir);
 
	}
 

	
 
	return _price.remove_train_depot;
 
}
 

	
 
static int32 ClearTile_Track(TileIndex tile, byte flags)
train_cmd.c
Show inline comments
 
@@ -3279,18 +3279,15 @@ void Train_Tick(Vehicle *v)
 
		if (++v->u.rail.crash_anim_pos >= 4400)
 
			DeleteVehicle(v);
 
	}
 
}
 

	
 

	
 
static const byte _depot_track_ind[4] = {0,1,0,1};
 

	
 

	
 
void TrainEnterDepot(Vehicle *v, TileIndex tile)
 
{
 
	SetSignalsOnBothDir(tile, _depot_track_ind[GetRailDepotDirection(tile)]);
 
	UpdateSignalsOnSegment(tile, GetRailDepotDirection(tile));
 

	
 
	if (!IsFrontEngine(v)) v = GetFirstVehicleInChain(v);
 

	
 
	VehicleServiceInDepot(v);
 

	
 
	InvalidateWindow(WC_VEHICLE_DETAILS, v->index);
0 comments (0 inline, 0 general)