--- a/clear_cmd.c Tue Apr 25 07:29:02 2006 +0000
+++ b/clear_cmd.c Tue Apr 25 07:32:33 2006 +0000
@@ -745,6 +745,5 @@
ChangeTileOwner_Clear, /* change_tile_owner_clear */
NULL, /* get_produced_cargo_proc */
NULL, /* vehicle_enter_tile_proc */
- NULL, /* vehicle_leave_tile_proc */
GetSlopeTileh_Clear, /* get_slope_tileh_proc */
};
--- a/dummy_land.c Tue Apr 25 07:29:02 2006 +0000
+++ b/dummy_land.c Tue Apr 25 07:32:33 2006 +0000
@@ -79,6 +79,5 @@
ChangeTileOwner_Dummy, /* change_tile_owner_clear */
NULL, /* get_produced_cargo_proc */
NULL, /* vehicle_enter_tile_proc */
- NULL, /* vehicle_leave_tile_proc */
GetSlopeTileh_Dummy, /* get_slope_tileh_proc */
};
--- a/industry_cmd.c Tue Apr 25 07:29:02 2006 +0000
+++ b/industry_cmd.c Tue Apr 25 07:32:33 2006 +0000
@@ -1891,7 +1891,6 @@
ChangeTileOwner_Industry, /* change_tile_owner_proc */
GetProducedCargo_Industry, /* get_produced_cargo_proc */
NULL, /* vehicle_enter_tile_proc */
- NULL, /* vehicle_leave_tile_proc */
GetSlopeTileh_Industry, /* get_slope_tileh_proc */
};
--- a/openttd.h Tue Apr 25 07:29:02 2006 +0000
+++ b/openttd.h Tue Apr 25 07:32:33 2006 +0000
@@ -331,7 +331,6 @@
* bit 0x8 set, the vehicle could not and did not enter the tile. Are there
* other bits that can be set? */
typedef uint32 VehicleEnterTileProc(Vehicle *v, TileIndex tile, int x, int y);
-typedef void VehicleLeaveTileProc(Vehicle *v, TileIndex tile, int x, int y);
typedef Slope GetSlopeTilehProc(TileIndex, Slope tileh);
typedef struct {
@@ -347,7 +346,6 @@
ChangeTileOwnerProc *change_tile_owner_proc;
GetProducedCargoProc *get_produced_cargo_proc;
VehicleEnterTileProc *vehicle_enter_tile_proc;
- VehicleLeaveTileProc *vehicle_leave_tile_proc;
GetSlopeTilehProc *get_slope_tileh_proc;
} TileTypeProcs;
--- a/rail_cmd.c Tue Apr 25 07:29:02 2006 +0000
+++ b/rail_cmd.c Tue Apr 25 07:32:33 2006 +0000
@@ -2028,6 +2028,5 @@
ChangeTileOwner_Track, /* change_tile_owner_clear */
NULL, /* get_produced_cargo_proc */
VehicleEnter_Track, /* vehicle_enter_tile_proc */
- NULL, /* vehicle_leave_tile_proc */
GetSlopeTileh_Track, /* get_slope_tileh_proc */
};
--- a/road_cmd.c Tue Apr 25 07:29:02 2006 +0000
+++ b/road_cmd.c Tue Apr 25 07:32:33 2006 +0000
@@ -1049,13 +1049,6 @@
return 0;
}
-static void VehicleLeave_Road(Vehicle *v, TileIndex tile, int x, int y)
-{
- if (IsLevelCrossing(tile) && v->type == VEH_Train && v->next == NULL) {
- UnbarCrossing(tile);
- MarkTileDirtyByTile(tile);
- }
-}
static void ChangeTileOwner_Road(TileIndex tile, PlayerID old_player, PlayerID new_player)
{
@@ -1103,6 +1096,5 @@
ChangeTileOwner_Road, /* change_tile_owner_clear */
NULL, /* get_produced_cargo_proc */
VehicleEnter_Road, /* vehicle_enter_tile_proc */
- VehicleLeave_Road, /* vehicle_leave_tile_proc */
GetSlopeTileh_Road, /* get_slope_tileh_proc */
};
--- a/station_cmd.c Tue Apr 25 07:29:02 2006 +0000
+++ b/station_cmd.c Tue Apr 25 07:32:33 2006 +0000
@@ -2782,7 +2782,6 @@
ChangeTileOwner_Station, /* change_tile_owner_clear */
NULL, /* get_produced_cargo_proc */
VehicleEnter_Station, /* vehicle_enter_tile_proc */
- NULL, /* vehicle_leave_tile_proc */
GetSlopeTileh_Station, /* get_slope_tileh_proc */
};
--- a/town_cmd.c Tue Apr 25 07:29:02 2006 +0000
+++ b/town_cmd.c Tue Apr 25 07:32:33 2006 +0000
@@ -1866,7 +1866,6 @@
ChangeTileOwner_Town, /* change_tile_owner_clear */
NULL, /* get_produced_cargo_proc */
NULL, /* vehicle_enter_tile_proc */
- NULL, /* vehicle_leave_tile_proc */
GetSlopeTileh_Town, /* get_slope_tileh_proc */
};
--- a/train_cmd.c Tue Apr 25 07:29:02 2006 +0000
+++ b/train_cmd.c Tue Apr 25 07:32:33 2006 +0000
@@ -2931,6 +2931,11 @@
goto invalid_rail;
}
+ if (IsLevelCrossingTile(v->tile) && v->next == NULL) {
+ UnbarCrossing(v->tile);
+ MarkTileDirtyByTile(v->tile);
+ }
+
if (IsFrontEngine(v)) v->load_unload_time_rem = 0;
if (!(r&0x4)) {
--- a/tree_cmd.c Tue Apr 25 07:29:02 2006 +0000
+++ b/tree_cmd.c Tue Apr 25 07:32:33 2006 +0000
@@ -591,6 +591,5 @@
ChangeTileOwner_Trees, /* change_tile_owner_clear */
NULL, /* get_produced_cargo_proc */
NULL, /* vehicle_enter_tile_proc */
- NULL, /* vehicle_leave_tile_proc */
GetSlopeTileh_Trees, /* get_slope_tileh_proc */
};
--- a/tunnelbridge_cmd.c Tue Apr 25 07:29:02 2006 +0000
+++ b/tunnelbridge_cmd.c Tue Apr 25 07:32:33 2006 +0000
@@ -1398,6 +1398,5 @@
ChangeTileOwner_TunnelBridge, /* change_tile_owner_clear */
NULL, /* get_produced_cargo_proc */
VehicleEnter_TunnelBridge, /* vehicle_enter_tile_proc */
- NULL, /* vehicle_leave_tile_proc */
GetSlopeTileh_TunnelBridge, /* get_slope_tileh_proc */
};
--- a/unmovable_cmd.c Tue Apr 25 07:29:02 2006 +0000
+++ b/unmovable_cmd.c Tue Apr 25 07:32:33 2006 +0000
@@ -393,6 +393,5 @@
ChangeTileOwner_Unmovable, /* change_tile_owner_clear */
NULL, /* get_produced_cargo_proc */
NULL, /* vehicle_enter_tile_proc */
- NULL, /* vehicle_leave_tile_proc */
GetSlopeTileh_Unmovable, /* get_slope_tileh_proc */
};
--- a/vehicle.c Tue Apr 25 07:29:02 2006 +0000
+++ b/vehicle.c Tue Apr 25 07:32:33 2006 +0000
@@ -2012,18 +2012,7 @@
* 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)
--- a/water_cmd.c Tue Apr 25 07:29:02 2006 +0000
+++ b/water_cmd.c Tue Apr 25 07:32:33 2006 +0000
@@ -716,6 +716,5 @@
ChangeTileOwner_Water, /* change_tile_owner_clear */
NULL, /* get_produced_cargo_proc */
VehicleEnter_Water, /* vehicle_enter_tile_proc */
- NULL, /* vehicle_leave_tile_proc */
GetSlopeTileh_Water, /* get_slope_tileh_proc */
};