From 80b20e0c236ba8d42856a10922de23921b267ff8 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sat, 26 Mar 2022 09:50:07 +0200 Subject: [PATCH 44/44] Set resources on player map (FoW map) when loading saved game Reported by ddeanbrown See osdn #44176 Signed-off-by: Marko Lindqvist --- server/savegame/savegame3.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/server/savegame/savegame3.c b/server/savegame/savegame3.c index 7c9c82f3af..366f2c6073 100644 --- a/server/savegame/savegame3.c +++ b/server/savegame/savegame3.c @@ -6748,6 +6748,17 @@ static void sg_load_player_vision(struct loaddata *loading, loading->file, "player%d.map_e%02d_%04d", plrno, j); } halfbyte_iterate_extras_end; + whole_map_iterate(&(wld.map), ptile) { + struct player_tile *plrtile = map_get_player_tile(ptile, plr); + + extra_type_by_cause_iterate(EC_RESOURCE, pres) { + if (BV_ISSET(plrtile->extras, extra_number(pres)) + && terrain_has_resource(plrtile->terrain, pres)) { + plrtile->resource = pres; + } + } extra_type_by_cause_iterate_end; + } whole_map_iterate_end; + if (game.server.foggedborders) { /* Load player map (border). */ int x, y; -- 2.35.1