URL: http://bugs.freeciv.org/Ticket/Display.html?id=40598
[book - Sun Dec 14 06:25:45 2008]:
[chrisk - Sun Dec 14 05:58:11 2008]:
Trunk Revision 15365 GTK
All my embassies get lost when I save the game and reload it.
Pretty new.
Probably another case of players_iterate vs. player_slots_iterate.
I'll check it out.
The attached patch should fix the problem.
---
ロビーにハムスターがいるんだ。
diff --git a/server/savegame.c b/server/savegame.c
index 16256a0..1fe662b 100644
--- a/server/savegame.c
+++ b/server/savegame.c
@@ -2060,23 +2060,22 @@ static void player_load_main(struct player *plr, int plrno,
BV_CLR_ALL(plr-embassy);
if (has_capability(embassies, savefile_options)) {
-players_iterate(pother) {
- if (secfile_lookup_bool(file, player%d.embassy%d,
- plrno, player_number(pother))) {
+player_slots_iterate(pother) {
+ if (secfile_lookup_bool_default(file, FALSE, player%d.embassy%d,
+ plrno, player_index(pother))) {
BV_SET(plr-embassy, player_index(pother));
}
-} players_iterate_end;
+} player_slots_iterate_end;
} else {
/* Required for 2.0 and earlier savegames. Remove eventually and make
* the cap check mandatory. */
int embassy = secfile_lookup_int(file, player%d.embassy, plrno);
-players_iterate(pother) {
+player_slots_iterate(pother) {
if (embassy (1 player_index(pother))) {
BV_SET(plr-embassy, player_index(pother));
}
-} players_iterate_end;
-
+} player_slots_iterate_end;
}
p = secfile_lookup_str_default(file, NULL, player%d.city_style_by_name,
___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev