diff options
author | tron <tron@openttd.org> | 2006-03-24 12:00:24 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2006-03-24 12:00:24 +0000 |
commit | c699d0e791c31170557351d4d46637b3c253dc90 (patch) | |
tree | a82b65f2906613e4cab8c42090a411b44dbd6b00 /rail_cmd.c | |
parent | 85c49764e1a69f229010f376e3d5aee186436ca3 (diff) | |
download | openttd-c699d0e791c31170557351d4d46637b3c253dc90.tar.xz |
(svn r4085) Add GetTown{Index,ByTile}() to get the town index resp. the town from a tile
Diffstat (limited to 'rail_cmd.c')
-rw-r--r-- | rail_cmd.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/rail_cmd.c b/rail_cmd.c index 106087ea5..8e4094d14 100644 --- a/rail_cmd.c +++ b/rail_cmd.c @@ -11,6 +11,7 @@ #include "table/strings.h" #include "map.h" #include "tile.h" +#include "town_map.h" #include "tunnel_map.h" #include "vehicle.h" #include "viewport.h" @@ -321,7 +322,7 @@ int32 CmdBuildSingleRail(int x, int y, uint32 flags, uint32 p1, uint32 p2) (track == TRACK_Y && GetRoadBits(tile) == ROAD_X) )) { if (flags & DC_EXEC) { - MakeRoadCrossing(tile, GetTileOwner(tile), _current_player, (track == TRACK_X ? AXIS_Y : AXIS_X), p1, _m[tile].m2); + MakeRoadCrossing(tile, GetTileOwner(tile), _current_player, (track == TRACK_X ? AXIS_Y : AXIS_X), p1, GetTownIndex(tile)); } break; } @@ -396,7 +397,7 @@ int32 CmdRemoveSingleRail(int x, int y, uint32 flags, uint32 p1, uint32 p2) } if (flags & DC_EXEC) { - MakeRoadNormal(tile, GetCrossingRoadOwner(tile), GetCrossingRoadBits(tile), _m[tile].m2); + MakeRoadNormal(tile, GetCrossingRoadOwner(tile), GetCrossingRoadBits(tile), GetTownIndex(tile)); } break; } |