From 26ec228dca9bb805fb1d37945e9107efd0787eac Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sat, 26 Mar 2022 09:46:38 +0200 Subject: [PATCH 17/17] Set resources on player map (FoW map) when loading saved game Reported by ddeanbrown See osdn #44176 Signed-off-by: Marko Lindqvist --- server/savegame3.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/server/savegame3.c b/server/savegame3.c index 380c3baeb1..03bc82d49d 100644 --- a/server/savegame3.c +++ b/server/savegame3.c @@ -6157,6 +6157,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(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