diff options
author | rubidium <rubidium@openttd.org> | 2007-02-12 12:52:37 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2007-02-12 12:52:37 +0000 |
commit | 997534a5ea737fc153266dc2fb6d27cb3ff2f354 (patch) | |
tree | f74551630de47cd9dfc07418a279abdfb993526a | |
parent | 704c80f27e8a0df33c4db166839f61d6db6757b5 (diff) | |
download | openttd-997534a5ea737fc153266dc2fb6d27cb3ff2f354.tar.xz |
(svn r8689) -Fix [FS#613] (r8619): crash when an old savegame had buoys on the northern edge of the map.
-rw-r--r-- | src/openttd.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/openttd.cpp b/src/openttd.cpp index be9cd54ea..e5bce69e5 100644 --- a/src/openttd.cpp +++ b/src/openttd.cpp @@ -1776,6 +1776,15 @@ bool AfterLoadGame(void) } } + /* Buoys do now store the owner of the previous water tile, which can never + * be OWNER_NONE. So replace OWNER_NONE with OWNER_WATER. */ + if (CheckSavegameVersion(46)) { + Station *st; + FOR_ALL_STATIONS(st) { + if (st->IsBuoy() && IsTileOwner(st->xy, OWNER_NONE)) SetTileOwner(st->xy, OWNER_WATER); + } + } + return true; } |