From a007d609afec5e40d2aef362aca90d3a53580c8d Mon Sep 17 00:00:00 2001 From: rubidium Date: Thu, 16 Jul 2009 22:58:06 +0000 Subject: (svn r16854) -Fix (r2046): savegames from before this version would get the town id as their 'index' (#name = CopyFromOldName(c->name_1); @@ -526,9 +529,6 @@ bool AfterLoadGame() } } - /* Update all waypoints */ - if (CheckSavegameVersion(12)) FixOldWaypoints(); - /* make sure there is a town in the game */ if (_game_mode == GM_NORMAL && !ClosestTownFromTile(0, UINT_MAX)) { SetSaveLoadError(STR_NO_TOWN_IN_SCENARIO); diff --git a/src/saveload/waypoint_sl.cpp b/src/saveload/waypoint_sl.cpp index b6b27a337..3298e56a9 100644 --- a/src/saveload/waypoint_sl.cpp +++ b/src/saveload/waypoint_sl.cpp @@ -45,8 +45,8 @@ void FixOldWaypoints() FOR_ALL_WAYPOINTS(wp) { wp->town_index = ClosestTownFromTile(wp->xy, UINT_MAX)->index; wp->town_cn = 0; - if (wp->string_id & 0xC000) { - wp->town_cn = wp->string_id & 0x3F; + if ((wp->string_id & 0xC000) == 0xC000) { + wp->town_cn = (wp->string_id >> 8) & 0x3F; wp->string_id = STR_NULL; } } -- cgit v1.2.3-70-g09d2