(svn r4572) Remove vehicle_leave_tile_proc
There's exactly one implemented function (unbarring a level crossing) and one place where it can be triggered (a train leaves a level crossing) It's a bit overkill, so just handle this one case where it can happen
This commit is contained in:
13
vehicle.c
13
vehicle.c
@@ -2012,18 +2012,7 @@ Trackdir GetVehicleTrackdir(const Vehicle* v)
|
||||
* other bits that can be set? */
|
||||
uint32 VehicleEnterTile(Vehicle *v, TileIndex tile, int x, int y)
|
||||
{
|
||||
TileIndex old_tile = v->tile;
|
||||
uint32 result = _tile_type_procs[GetTileType(tile)]->vehicle_enter_tile_proc(v, tile, x, y);
|
||||
|
||||
/* When vehicle_enter_tile_proc returns 8, that apparently means that
|
||||
* we cannot enter the tile at all. In that case, don't call
|
||||
* leave_tile. */
|
||||
if (!(result & 8) && old_tile != tile) {
|
||||
VehicleLeaveTileProc *proc = _tile_type_procs[GetTileType(old_tile)]->vehicle_leave_tile_proc;
|
||||
if (proc != NULL)
|
||||
proc(v, old_tile, x, y);
|
||||
}
|
||||
return result;
|
||||
return _tile_type_procs[GetTileType(tile)]->vehicle_enter_tile_proc(v, tile, x, y);
|
||||
}
|
||||
|
||||
UnitID GetFreeUnitNumber(byte type)
|
||||
|
||||
Reference in New Issue
Block a user