Skip to content

Commit

Permalink
Set resources on player map (FoW map) when loading saved game
Browse files Browse the repository at this point in the history
Reported by ddeanbrown

See osdn #44176

Signed-off-by: Marko Lindqvist <[email protected]>

----
Cherry-picked from Freeciv commit a53bc138c9bb27a59a919c3d8c2f01ba0b84ea05
  • Loading branch information
cazfi authored and jwrober committed Jan 29, 2023
1 parent 80b445e commit 0774f65
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions server/savegame/savegame3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6641,6 +6641,21 @@ static void sg_load_player_vision(struct loaddata *loading,
}
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;
Expand Down

0 comments on commit 0774f65

Please sign in to comment.