From 23b1f53ff65286b47284d7a75d1b6e9288c3eb39 Mon Sep 17 00:00:00 2001 From: belugas Date: Sat, 23 Aug 2008 02:15:46 +0000 Subject: (svn r14135) -Codechange: Add owner to waypoints. Previously, it was guessed from rail underneath it. --- src/openttd.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/openttd.cpp') 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); -- cgit v1.2.3-54-g00ecf