(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:
tron
2006-04-25 07:32:33 +00:00
parent 288f4eed65
commit 18ad0ae50e
14 changed files with 6 additions and 32 deletions

View File

@@ -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)