From 997534a5ea737fc153266dc2fb6d27cb3ff2f354 Mon Sep 17 00:00:00 2001 From: rubidium Date: Mon, 12 Feb 2007 12:52:37 +0000 Subject: [PATCH] (svn r8689) -Fix [FS#613] (r8619): crash when an old savegame had buoys on the northern edge of the map. --- src/openttd.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/openttd.cpp b/src/openttd.cpp index be9cd54ead..e5bce69e52 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; }