summaryrefslogtreecommitdiff
path: root/src/openttd.cpp
diff options
context:
space:
mode:
authorbelugas <belugas@openttd.org>2008-08-23 02:15:46 +0000
committerbelugas <belugas@openttd.org>2008-08-23 02:15:46 +0000
commit7dc212edeba11703d3b8a5f4105dbb0102f122ab (patch)
tree3c9c32817a645ea313b3ef2cc9da69a40f7820ea /src/openttd.cpp
parentf625ecbeba53c4d25cd2ad2755924448522af8e9 (diff)
downloadopenttd-7dc212edeba11703d3b8a5f4105dbb0102f122ab.tar.xz
(svn r14135) -Codechange: Add owner to waypoints. Previously, it was guessed from rail underneath it.
Diffstat (limited to 'src/openttd.cpp')
-rw-r--r--src/openttd.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/openttd.cpp b/src/openttd.cpp
index dbc1ebaeb..95551dbb5 100644
--- a/src/openttd.cpp
+++ b/src/openttd.cpp
@@ -2516,6 +2516,15 @@ bool AfterLoadGame()
}
}
}
+
+ /* Give owners to waypoints, based on rail tracks it is sitting on.
+ * If none is available, specify OWNER_NONE */
+ Waypoint *wp;
+ Owner owner;
+ FOR_ALL_WAYPOINTS(wp) {
+ owner = GetTileOwner(wp->xy);
+ wp->owner = IsValidPlayerID(owner) ? owner : OWNER_NONE;
+ }
}
GamelogPrintDebug(1);