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 | 88d27219b47c9398e9aec354ec0bd59ae9912486 (patch) | |
tree | a82b65f2906613e4cab8c42090a411b44dbd6b00 /rail_cmd.c | |
parent | bb27e9abb34c48a39df3091ed55cce87be291720 (diff) | |
download | openttd-88d27219b47c9398e9aec354ec0bd59ae9912486.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; } |