summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2013-05-29 17:13:53 +0000
committerfrosch <frosch@openttd.org>2013-05-29 17:13:53 +0000
commit812faf08b59c0a4fdcd74e6f631e690c86ced9c1 (patch)
tree4e428e14063e31675a752f6a61be103252732078 /src
parentcaa324ba8900e4fd22041d55c52be652e45961e8 (diff)
downloadopenttd-812faf08b59c0a4fdcd74e6f631e690c86ced9c1.tar.xz
(svn r25302) -Fix [FS#5565]: Build railway fences next to objects, even if they are owned by the same company.
Diffstat (limited to 'src')
-rw-r--r--src/rail_cmd.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp
index 042108d68..152f2f54c 100644
--- a/src/rail_cmd.cpp
+++ b/src/rail_cmd.cpp
@@ -32,6 +32,7 @@
#include "date_func.h"
#include "strings_func.h"
#include "company_gui.h"
+#include "object_map.h"
#include "table/strings.h"
#include "table/railtypes.h"
@@ -2569,9 +2570,9 @@ static void TileLoop_Track(TileIndex tile)
TileIndex tile2 = tile + TileOffsByDiagDir(d);
- /* Show fences if it's a house, industry, road, tunnelbridge or not owned by us. */
+ /* Show fences if it's a house, industry, object, road, tunnelbridge or not owned by us. */
if (!IsValidTile(tile2) || IsTileType(tile2, MP_HOUSE) || IsTileType(tile2, MP_INDUSTRY) ||
- IsTileType(tile2, MP_ROAD) || IsTileType(tile2, MP_TUNNELBRIDGE) || !IsTileOwner(tile2, owner)) {
+ IsTileType(tile2, MP_ROAD) || (IsTileType(tile2, MP_OBJECT) && !IsOwnedLand(tile2)) || IsTileType(tile2, MP_TUNNELBRIDGE) || !IsTileOwner(tile2, owner)) {
fences |= 1 << d;
}
}