diff -Nur -Xfreecivdiff.ignore freeciv-cvs/client/climisc.c freeciv-patched/client/climisc.c --- freeciv-cvs/client/climisc.c 2003-07-10 11:53:37.000000000 +0100 +++ freeciv-patched/client/climisc.c 2003-07-24 17:04:26.000000000 +0100 @@ -132,7 +132,7 @@ built_impr_iterate(pcity, i) { effect_update = TRUE; - city_remove_improvement(pcity, i); + city_remove_improvement(pcity, i, TRUE); } built_impr_iterate_end; if (effect_update) { diff -Nur -Xfreecivdiff.ignore freeciv-cvs/client/packhand.c freeciv-patched/client/packhand.c --- freeciv-cvs/client/packhand.c 2003-07-24 17:04:26.000000000 +0100 +++ freeciv-patched/client/packhand.c 2003-07-24 17:04:26.000000000 +0100 @@ -270,7 +270,7 @@ *impr_changed = TRUE; } } else if (!have_impr && pcity->improvements[impr] != I_NONE) { - city_remove_improvement(pcity, impr); + city_remove_improvement(pcity, impr, FALSE); if (impr_changed) { *impr_changed = TRUE; @@ -1189,6 +1189,43 @@ /************************************************************************** ... **************************************************************************/ +static bool update_wonder(Impr_Type_id impr, int cityid, int plrno) +{ + struct player *pplayer; + bool retval = FALSE; + + if (!is_wonder(impr)) + return FALSE; + + if (plrno == -1) { + pplayer = NULL; + } else { + pplayer = &game.players[plrno]; + } + + /* Newly destroyed wonder */ + if (cityid == -1 && game.global_wonders[impr] >= 0) { + add_destroyed_improvement(pplayer, impr); + retval = TRUE; + } + + if (cityid >= 0 && improvement_types[impr].equiv_range == EFR_WORLD) { + if (cityid == -1 && game.improvements[impr] != I_NONE) { + game.improvements[impr] = I_NONE; + retval = TRUE; + } else if (cityid >= 0 && game.improvements[impr] == I_NONE) { + game.improvements[impr] = I_ACTIVE; + retval = TRUE; + } + } + game.global_wonders[impr] = cityid; + game.destroyed_owner[impr] = pplayer; + return retval; +} + +/************************************************************************** +... +**************************************************************************/ void handle_game_info(struct packet_game_info *pinfo) { int i; @@ -1241,20 +1278,8 @@ for(i=0; iglobal_advances[i]; for(i=0; iglobal_wonders[i]; -/* Only add in the improvement if it's in a "foreign" (i.e. unknown) city - and has equiv_range==World - otherwise we deal with it in its home - city anyway */ - if (is_wonder(i) && improvement_types[i].equiv_range==EFR_WORLD && - !find_city_by_id(game.global_wonders[i])) { - if (game.global_wonders[i] <= 0 && game.improvements[i] != I_NONE) { - game.improvements[i] = I_NONE; - need_effect_update = TRUE; - } else if (game.global_wonders[i] > 0 && game.improvements[i] == I_NONE) { - game.improvements[i] = I_ACTIVE; - need_effect_update = TRUE; - } - } + need_effect_update |= update_wonder(i, pinfo->global_wonders[i], + pinfo->destroyed_owner[i]); } /* Only update effects if a new wonder appeared or was destroyed */ diff -Nur -Xfreecivdiff.ignore freeciv-cvs/common/city.c freeciv-patched/common/city.c --- freeciv-cvs/common/city.c 2003-07-24 17:04:26.000000000 +0100 +++ freeciv-patched/common/city.c 2003-07-24 17:04:26.000000000 +0100 @@ -2622,11 +2622,16 @@ Removes an improvement (and its effects) from a city, and updates the global arrays if the improvement has effects and/or an equiv_range that extend outside of the city. + If "is_destroyed" is TRUE, then the improvement has been destroyed; any + effects with "survives" set are to be preserved. + N.B. Must call update_all_effects() to resolve dependencies. **************************************************************************/ -void city_remove_improvement(struct city *pcity,Impr_Type_id impr) +void city_remove_improvement(struct city *pcity,Impr_Type_id impr, + bool is_destroyed) { struct ceff_vector *ceffs[2]; struct geff_vector *geffs[4]; + bool survives = FALSE; int i, j; freelog(LOG_DEBUG,"Improvement %s removed from city %s", @@ -2645,6 +2650,18 @@ } players_iterate_end; } + /* Are there actually any destruction-surviving effects? */ + if (is_destroyed) { + struct impr_effect *imeff; + for (imeff = improvement_types[impr].effect; + imeff && imeff->type != EFT_LAST; imeff++) { + if (imeff->survives) { + survives = TRUE; + break; + } + } + } + get_effect_vectors(ceffs, geffs, impr, pcity); /* Remove the base city effects */ for (j = 0; ceffs[j]; j++) { @@ -2657,13 +2674,26 @@ } } - /* Remove the global-range effects */ - for (j = 0; geffs[j]; ++j) { - for (i = 0; i < geff_vector_size(geffs[j]); ++i) { - struct eff_global *eff = geff_vector_get(geffs[j], i); - if (eff->eff.impr == impr) { - eff->eff.impr = B_LAST; - break; + if (survives) { + /* Add the effects to the player's "destroyed effects" list */ + struct eff_city *eff; + struct player *pplayer = city_owner(pcity); + + eff = append_ceff(&pplayer->destroyed_effects); + eff->impr = impr; + eff->active = 0; + freelog(LOG_DEBUG, "Effects of %s moved to player's destroyed effects list", + get_improvement_name(impr)); + game.destroyed_owner[impr] = pplayer; + } else { + /* Remove the global-range effects */ + for (j = 0; geffs[j]; ++j) { + for (i = 0; i < geff_vector_size(geffs[j]); ++i) { + struct eff_global *eff = geff_vector_get(geffs[j], i); + if (eff->eff.impr == impr) { + eff->eff.impr = B_LAST; + break; + } } } } diff -Nur -Xfreecivdiff.ignore freeciv-cvs/common/city.h freeciv-patched/common/city.h --- freeciv-cvs/common/city.h 2003-07-24 17:02:53.000000000 +0100 +++ freeciv-patched/common/city.h 2003-07-24 17:04:26.000000000 +0100 @@ -484,7 +484,8 @@ int city_granary_size(int city_size); void city_add_improvement(struct city *pcity,Impr_Type_id impr); -void city_remove_improvement(struct city *pcity,Impr_Type_id impr); +void city_remove_improvement(struct city *pcity, Impr_Type_id impr, + bool is_destroyed); /* city update functions */ void update_city_bonuses(struct city *pcity); diff -Nur -Xfreecivdiff.ignore freeciv-cvs/common/game.c freeciv-patched/common/game.c --- freeciv-cvs/common/game.c 2003-07-24 16:59:50.000000000 +0100 +++ freeciv-patched/common/game.c 2003-07-24 17:04:26.000000000 +0100 @@ -169,6 +169,15 @@ **************************************************************************/ void game_remove_city(struct city *pcity) { + int i; + + /* Update list of destroyed wonders properly */ + for (i = 0; i < B_LAST; i++) { + if (game.global_wonders[i] == pcity->id) { + game.global_wonders[i] = -1; + } + } + freelog(LOG_DEBUG, "game_remove_city %d", pcity->id); freelog(LOG_DEBUG, "removing city %s, %s, (%d %d)", pcity->name, get_nation_name(city_owner(pcity)->nation), pcity->x, pcity->y); @@ -254,6 +263,9 @@ geff_vector_init(&game.effects); ceff_vector_init(&game.destroyed_effects); + for (i = 0; i < B_LAST; i++) { + game.destroyed_owner[i] = NULL; + } game.heating = 0; game.cooling = 0; @@ -441,6 +453,7 @@ } geff_vector_free(&pplayer->effects); + ceff_vector_free(&pplayer->destroyed_effects); if (pplayer->island_improv) { free(pplayer->island_improv); pplayer->island_improv = NULL; @@ -701,7 +714,16 @@ struct ceff_vector *ceff = get_eff_city(pcity); update_city_effects(ceff, pcity, pplayer, &cond_eff, &changed); } city_list_iterate_end; + + /* Update all effects of this player's destroyed Wonders */ + update_city_effects(&pplayer->destroyed_effects, NULL, pplayer, + &cond_eff, &changed); } players_iterate_end; + + /* Update all effects of destroyed Wonders that belonged to + * now-dead players */ + update_city_effects(&game.destroyed_effects, NULL, NULL, + &cond_eff, &changed); } while (changed && cond_eff); players_iterate(pplayer) { diff -Nur -Xfreecivdiff.ignore freeciv-cvs/common/game.h freeciv-patched/common/game.h --- freeciv-cvs/common/game.h 2003-07-24 16:57:16.000000000 +0100 +++ freeciv-patched/common/game.h 2003-07-24 17:04:26.000000000 +0100 @@ -106,12 +106,14 @@ struct conn_list game_connections; /* involved in game; send map etc */ int global_advances[A_LAST]; /* a counter */ int global_wonders[B_LAST]; /* contains city id's */ - /* global_wonders[] may also be (-1), or the id of a city - which no longer exists, if the wonder has been destroyed */ + /* global_wonders[] may also be (-1) if the wonder has been destroyed */ + struct player *destroyed_owner[B_LAST]; /* the player that owns each + * destroyed Wonder */ Impr_Status improvements[B_LAST]; /* impr. with equiv_range==World */ struct geff_vector effects; /* effects with range==World */ struct ceff_vector destroyed_effects; /* list of effects that have - survived building destruction */ + * survived building and + * player destruction */ int heating; /* Number of polluted squares. */ int globalwarming; /* Total damage done. (counts towards a warming event.) */ diff -Nur -Xfreecivdiff.ignore freeciv-cvs/common/improvement.c freeciv-patched/common/improvement.c --- freeciv-cvs/common/improvement.c 2003-07-24 17:04:26.000000000 +0100 +++ freeciv-patched/common/improvement.c 2003-07-24 17:04:26.000000000 +0100 @@ -1002,7 +1002,8 @@ Returns TRUE if the given effect (in the given city, owned by the given player) is activated by all of the necessary prerequisites; *cond_eff is set to TRUE if the effect could not be activated because it - depends on another effect + depends on another effect; + pcity and/or pplayer can be NULL for destroyed effects. Note: the cond_bldg field, and the various aff_xxx fields, are not checked, as one effect may affect several cities, terrains, etc. Use the is_city_affected and is_unit_terrain_affected functions to @@ -1012,12 +1013,12 @@ struct player *pplayer, struct impr_effect *imeff, bool *cond_eff) { - if (imeff->cond_gov != game.government_count + if (imeff->cond_gov != game.government_count && pplayer && pplayer->government != imeff->cond_gov) { freelog(LOG_DEBUG, "Effect requires a government"); return FALSE; } - if (get_invention(pplayer, imeff->cond_adv) != TECH_KNOWN) { + if (pplayer && get_invention(pplayer, imeff->cond_adv) != TECH_KNOWN) { freelog(LOG_DEBUG, "Effect requires a future tech"); return FALSE; } @@ -1290,3 +1291,47 @@ } return B_LAST; } + +/************************************************************************** + Adds the effects of a previously-destroyed improvement to the given + players's destroyed effects vector (if player=NULL, then adds them to + the global game destroyed effects vector instead). +**************************************************************************/ +void add_destroyed_improvement(struct player *p, Impr_Type_id id) +{ + struct impr_effect *eff; + struct geff_vector *globeff[2] = { NULL, NULL }; + struct ceff_vector *desteff; + struct eff_city *ceff; + int i; + + game.destroyed_owner[id] = p; + freelog(LOG_DEBUG, "Adding destroyed improvement %s to %s", + improvement_types[id].name, p ? p->name : "global list"); + for (eff = improvement_types[id].effect; + eff && eff->type != EFT_LAST; eff++) { + if (eff->survives) { + if (eff->range == EFR_WORLD) { + globeff[1] = get_eff_world(); + } else if (eff->range == EFR_PLAYER && p) { + globeff[0] = get_eff_player(p); + } + } + } + + desteff = (p ? &p->destroyed_effects : &game.destroyed_effects); + ceff = append_ceff(desteff); + ceff->impr = id; + ceff->active = 0; + + for (i = 0; i < 2; i++) { + if (globeff[i]) { + struct eff_global *geff; + + geff = append_geff(globeff[i]); + geff->eff.impr = id; + geff->eff.active = 0; + geff->cityid = -1; + } + } +} diff -Nur -Xfreecivdiff.ignore freeciv-cvs/common/improvement.h freeciv-patched/common/improvement.h --- freeciv-cvs/common/improvement.h 2003-07-24 17:04:26.000000000 +0100 +++ freeciv-patched/common/improvement.h 2003-07-24 17:04:26.000000000 +0100 @@ -408,6 +408,7 @@ bool can_player_build_improvement(struct player *p, Impr_Type_id id); /* city related improvement functions */ +void add_destroyed_improvement(struct player *p, Impr_Type_id id); void mark_improvement(struct city *pcity,Impr_Type_id id,Impr_Status status); struct geff_vector *get_eff_world(void); struct geff_vector *get_eff_player(struct player *plr); diff -Nur -Xfreecivdiff.ignore freeciv-cvs/common/packets.c freeciv-patched/common/packets.c --- freeciv-cvs/common/packets.c 2003-07-24 17:02:26.000000000 +0100 +++ freeciv-patched/common/packets.c 2003-07-24 17:04:26.000000000 +0100 @@ -1059,7 +1059,11 @@ for (i = 0; i < A_LAST /*game.num_tech_types */ ; i++) dio_put_uint8(&dout, pinfo->global_advances[i]); for (i = 0; i < B_LAST /*game.num_impr_types */ ; i++) - dio_put_uint16(&dout, pinfo->global_wonders[i]); + dio_put_sint16(&dout, pinfo->global_wonders[i]); + if (has_capability("impr_gen", pc->capability)) { + for (i = 0; i < B_LAST; i++) + dio_put_sint16(&dout, pinfo->destroyed_owner[i]); + } dio_put_uint8(&dout, pinfo->techpenalty); dio_put_uint8(&dout, pinfo->foodbox); @@ -1107,7 +1111,14 @@ for (i = 0; i < A_LAST /*game.num_tech_types */ ; i++) dio_get_uint8(&din, &pinfo->global_advances[i]); for (i = 0; i < B_LAST /*game.num_impr_types */ ; i++) - dio_get_uint16(&din, &pinfo->global_wonders[i]); + dio_get_sint16(&din, &pinfo->global_wonders[i]); + if (has_capability("impr_gen", pc->capability)) { + for (i = 0; i < B_LAST; i++) + dio_get_sint16(&din, &pinfo->destroyed_owner[i]); + } else { + for(i = 0; i < B_LAST; i++) + pinfo->destroyed_owner[i] = -1; + } dio_get_uint8(&din, &pinfo->techpenalty); dio_get_uint8(&din, &pinfo->foodbox); diff -Nur -Xfreecivdiff.ignore freeciv-cvs/common/packets.h freeciv-patched/common/packets.h --- freeciv-cvs/common/packets.h 2003-07-24 17:02:27.000000000 +0100 +++ freeciv-patched/common/packets.h 2003-07-24 17:04:26.000000000 +0100 @@ -882,6 +882,7 @@ int diplcost,freecost,conquercost; int global_advances[A_LAST]; int global_wonders[B_LAST]; + int destroyed_owner[B_LAST]; int foodbox; int techpenalty; bool spacerace; diff -Nur -Xfreecivdiff.ignore freeciv-cvs/common/player.c freeciv-patched/common/player.c --- freeciv-cvs/common/player.c 2003-07-24 17:04:26.000000000 +0100 +++ freeciv-patched/common/player.c 2003-07-24 17:04:26.000000000 +0100 @@ -132,6 +132,8 @@ improvement_status_init(plr->improvements, ARRAY_SIZE(plr->improvements)); /* Initialise vector of effects with player range. */ geff_vector_init(&plr->effects); + /* Initialise player's list of destroyed effects */ + ceff_vector_init(&plr->destroyed_effects); /* Initialise list of improvements with Island-wide equiv_range */ plr->island_improv = NULL; diff -Nur -Xfreecivdiff.ignore freeciv-cvs/common/player.h freeciv-patched/common/player.h --- freeciv-cvs/common/player.h 2003-07-24 17:03:11.000000000 +0100 +++ freeciv-patched/common/player.h 2003-07-24 17:04:26.000000000 +0100 @@ -207,6 +207,8 @@ [map.num_continents][game.num_impr_types] */ struct geff_vector effects; /* effects with range==Player */ struct geff_vector *island_effects; /* effects with range==Island */ + struct ceff_vector destroyed_effects;/* list of effects that have survived + * building destruction */ struct { int length; diff -Nur -Xfreecivdiff.ignore freeciv-cvs/server/citytools.c freeciv-patched/server/citytools.c --- freeciv-cvs/server/citytools.c 2003-07-24 17:02:27.000000000 +0100 +++ freeciv-patched/server/citytools.c 2003-07-24 17:04:26.000000000 +0100 @@ -848,7 +848,7 @@ then restore the local improvement list - we need this to restore the global effects for the new city owner) */ built_impr_iterate(pcity, i) { - city_remove_improvement(pcity, i); + city_remove_improvement(pcity, i, FALSE); pcity->improvements[i] = I_ACTIVE; } built_impr_iterate_end; @@ -1087,7 +1087,7 @@ built_impr_iterate(pcity, i) { effect_update = TRUE; - city_remove_improvement(pcity, i); + city_remove_improvement(pcity, i, TRUE); } built_impr_iterate_end; /* This is cutpasted with modifications from transfer_city_units. Yes, it is ugly. @@ -1800,7 +1800,7 @@ { struct player *owner = city_owner(pcity); - city_remove_improvement(pcity,id); + city_remove_improvement(pcity, id, FALSE); if (id == B_PALACE && ((owner->spaceship.state == SSHIP_STARTED) || (owner->spaceship.state == SSHIP_LAUNCHED))) { diff -Nur -Xfreecivdiff.ignore freeciv-cvs/server/cityturn.c freeciv-patched/server/cityturn.c --- freeciv-cvs/server/cityturn.c 2003-07-24 17:02:27.000000000 +0100 +++ freeciv-patched/server/cityturn.c 2003-07-24 17:04:26.000000000 +0100 @@ -954,7 +954,7 @@ if (pcity->currently_building == B_PALACE) { city_list_iterate(pplayer->cities, palace) if (city_got_building(palace, B_PALACE)) { - city_remove_improvement(palace, B_PALACE); + city_remove_improvement(palace, B_PALACE, FALSE); break; } city_list_iterate_end; diff -Nur -Xfreecivdiff.ignore freeciv-cvs/server/gamehand.c freeciv-patched/server/gamehand.c --- freeciv-cvs/server/gamehand.c 2003-07-24 16:57:16.000000000 +0100 +++ freeciv-patched/server/gamehand.c 2003-07-24 17:04:26.000000000 +0100 @@ -248,6 +248,10 @@ ginfo.global_advances[i] = game.global_advances[i]; for (i = 0; i < B_LAST /*game.num_impr_types */ ; i++) ginfo.global_wonders[i] = game.global_wonders[i]; + for (i = 0; i < B_LAST; i++) { + ginfo.destroyed_owner[i] = game.destroyed_owner[i] ? + game.destroyed_owner[i]->player_no : -1; + } /* the following values are computed every time a packet_game_info packet is created */ if (game.timeout != 0) { diff -Nur -Xfreecivdiff.ignore freeciv-cvs/server/plrhand.c freeciv-patched/server/plrhand.c --- freeciv-cvs/server/plrhand.c 2003-07-24 17:03:11.000000000 +0100 +++ freeciv-patched/server/plrhand.c 2003-07-24 17:04:26.000000000 +0100 @@ -179,6 +179,34 @@ } /************************************************************************** + Called when a player is eliminated; moves all of the player's destroyed + effects to the global destroyed effects list. +**************************************************************************/ +static void handle_player_destroyed_effects(struct player *pplayer) +{ + struct eff_city *plrceff, *gameceff; + struct ceff_vector *plrceffs, *gameceffs; + int i, needupdate = FALSE; + + plrceffs = &pplayer->destroyed_effects; + gameceffs = &game.destroyed_effects; + + for (i = 0; i < ceff_vector_size(plrceffs); ++i) { + plrceff = ceff_vector_get(plrceffs, i); + if (plrceff->impr < B_LAST) { + gameceff = append_ceff(gameceffs); + gameceff->impr = plrceff->impr; + gameceff->active = 0; + needupdate = TRUE; + freelog(LOG_DEBUG, "Effects of %s moved to global destroyed effects list", + get_improvement_name(plrceff->impr)); + game.destroyed_owner[plrceff->impr] = NULL; + } + } + if (needupdate) update_all_effects(); +} + +/************************************************************************** ... **************************************************************************/ void update_player_aliveness(struct player *pplayer) @@ -190,6 +218,7 @@ notify_player_ex(pplayer, -1, -1, E_GAME_END, _("Game: You are dead!")); pplayer->is_alive = FALSE; + handle_player_destroyed_effects(pplayer); if( !is_barbarian(pplayer) ) { notify_player_ex(NULL, -1, -1, E_DESTROYED, _("Game: The %s are no more!"), diff -Nur -Xfreecivdiff.ignore freeciv-cvs/server/savegame.c freeciv-patched/server/savegame.c --- freeciv-cvs/server/savegame.c 2003-07-24 17:00:39.000000000 +0100 +++ freeciv-patched/server/savegame.c 2003-07-24 17:04:26.000000000 +0100 @@ -157,7 +157,7 @@ and rulesets */ #define SAVEFILE_OPTIONS "startoptions spacerace2 rulesets" \ " diplchance_percent worklists2 map_editor known32fix turn " \ -"attributes watchtower rulesetdir client_worklists" +"attributes watchtower rulesetdir client_worklists impr_gen" static const char hex_chars[] = "0123456789abcdef"; static const char terrain_chars[] = "adfghjm prstu"; @@ -620,6 +620,18 @@ plr->city_style=secfile_lookup_int_default(file, get_nation_city_style(plr->nation), "player%d.city_style", plrno); + if (has_capability("impr_gen", savefile_options)) { + /* destroyed wonders: */ + p = secfile_lookup_str_default(file, "", "player%d.destroyed_wonders", + plrno); + for (i = 0; i < game.num_impr_types && p[i] != '\0'; i++) { + if (p[i] == '1') { + game.global_wonders[i] = -1; /* destroyed! */ + add_destroyed_improvement(plr, i); + } + } + } + plr->nturns_idle=0; plr->is_male=secfile_lookup_bool_default(file, TRUE, "player%d.is_male", plrno); plr->is_alive=secfile_lookup_bool(file, "player%d.is_alive", plrno); @@ -1316,6 +1328,26 @@ } /*************************************************************** + Makes a list of any destroyed improvements +***************************************************************/ +static void make_destroyed_list(char *temp, struct ceff_vector *ceff) +{ + int i, efflen = ceff_vector_size(ceff); + + for (i = 0; i < game.num_impr_types; i++) { + temp[i] = '0'; + } + + for (i = 0; i < efflen; i++) { + struct eff_city *eff; + + eff = ceff_vector_get(ceff, i); + temp[eff->impr] = '1'; + } + temp[game.num_impr_types] = '\0'; +} + +/*************************************************************** ... ***************************************************************/ static void player_save(struct player *plr, int plrno, @@ -1324,6 +1356,7 @@ int i; char invs[A_LAST+1]; struct player_spaceship *ship = &plr->spaceship; + char temp[B_LAST + 1]; secfile_insert_str(file, plr->name, "player%d.name", plrno); secfile_insert_str(file, plr->username, "player%d.username", plrno); @@ -1611,6 +1644,10 @@ } city_list_iterate_end; + /* destroyed wonders: */ + make_destroyed_list(temp, &plr->destroyed_effects); + secfile_insert_str(file, temp, "player%d.destroyed_wonders", plrno); + /********** Put the players private map **********/ /* Otherwise the player can see all, and there's no reason to save the private map. */ if (game.fogofwar @@ -2151,6 +2188,7 @@ } if (string[i] == '1') { game.global_wonders[i] = -1; /* destroyed! */ + add_destroyed_improvement(NULL, i); } } impr_type_iterate_end; out: @@ -2236,7 +2274,6 @@ int i; int version; char options[512]; - char temp[B_LAST+1]; version = MAJOR_VERSION *10000 + MINOR_VERSION *100 + PATCH_VERSION; secfile_insert_int(file, version, "game.version"); @@ -2383,16 +2420,10 @@ secfile_insert_bool(file, game.save_options.save_players, "game.save_players"); if (game.save_options.save_players) { + char temp[B_LAST + 1]; + /* destroyed wonders: */ - impr_type_iterate(i) { - if (is_wonder(i) && game.global_wonders[i]!=0 - && !find_city_by_id(game.global_wonders[i])) { - temp[i] = '1'; - } else { - temp[i] = '0'; - } - } impr_type_iterate_end; - temp[game.num_impr_types] = '\0'; + make_destroyed_list(temp, &game.destroyed_effects); secfile_insert_str(file, temp, "game.destroyed_wonders"); calc_unit_ordering();