summaryrefslogtreecommitdiff
path: root/road_cmd.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-03-24 12:00:24 +0000
committertron <tron@openttd.org>2006-03-24 12:00:24 +0000
commit88d27219b47c9398e9aec354ec0bd59ae9912486 (patch)
treea82b65f2906613e4cab8c42090a411b44dbd6b00 /road_cmd.c
parentbb27e9abb34c48a39df3091ed55cce87be291720 (diff)
downloadopenttd-88d27219b47c9398e9aec354ec0bd59ae9912486.tar.xz
(svn r4085) Add GetTown{Index,ByTile}() to get the town index resp. the town from a tile
Diffstat (limited to 'road_cmd.c')
-rw-r--r--road_cmd.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/road_cmd.c b/road_cmd.c
index b17388b5c..82284a7f9 100644
--- a/road_cmd.c
+++ b/road_cmd.c
@@ -10,6 +10,7 @@
#include "functions.h"
#include "map.h"
#include "tile.h"
+#include "town_map.h"
#include "vehicle.h"
#include "viewport.h"
#include "command.h"
@@ -109,7 +110,7 @@ int32 CmdRemoveRoad(int x, int y, uint32 flags, uint32 p1, uint32 p2)
if (IsTileType(tile, MP_TUNNELBRIDGE)) { // index of town is not saved for bridge (no space)
t = ClosestTownFromTile(tile, _patches.dist_local_authority);
} else {
- t = GetTown(_m[tile].m2);
+ t = GetTownByTile(tile);
}
} else {
t = NULL;
@@ -1106,7 +1107,7 @@ static void ChangeTileOwner_Road(TileIndex tile, PlayerID old_player, PlayerID n
break;
case ROAD_CROSSING:
- MakeRoadNormal(tile, GetCrossingRoadOwner(tile), GetCrossingRoadBits(tile), _m[tile].m2);
+ MakeRoadNormal(tile, GetCrossingRoadOwner(tile), GetCrossingRoadBits(tile), GetTownIndex(tile));
break;
default: