Complete.Org:
Mailing Lists:
Archives:
freeciv-dev:
September 2004: [Freeciv-Dev] (PR#9897) rename wonder_replacement |
![]() |
[Freeciv-Dev] (PR#9897) rename wonder_replacement[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://rt.freeciv.org/Ticket/Display.html?id=9897 > This patch renames wonder_replacement as building_replaced. Vasco does this in his effects patch. He also moves the function into effects.c; this can be done later or not at all. jason Index: ai/aicity.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/ai/aicity.c,v retrieving revision 1.160 diff -u -r1.160 aicity.c --- ai/aicity.c 13 Aug 2004 15:59:11 -0000 1.160 +++ ai/aicity.c 1 Sep 2004 14:34:14 -0000 @@ -646,7 +646,8 @@ built_impr_iterate(pcity, i) { if(!is_wonder(i) && i != B_CITY /* selling city walls is really, really dumb -- Syela */ - && (wonder_replacement(pcity, i) || building_unwanted(city_owner(pcity), i))) { + && (building_replaced(pcity, i) + || building_unwanted(city_owner(pcity), i))) { do_sell_building(pplayer, pcity, i); notify_player_ex(pplayer, pcity->x, pcity->y, E_IMP_SOLD, _("Game: %s is selling %s (not needed) for %d."), Index: client/citydlg_common.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/client/citydlg_common.c,v retrieving revision 1.44 diff -u -r1.44 citydlg_common.c --- client/citydlg_common.c 1 Sep 2004 03:16:47 -0000 1.44 +++ client/citydlg_common.c 1 Sep 2004 14:34:14 -0000 @@ -341,7 +341,7 @@ my_snprintf(buf[0], column_size, get_improvement_type(id)->name); /* from city.c get_impr_name_ex() */ - if (pcity && wonder_replacement(pcity, id)) { + if (pcity && building_replaced(pcity, id)) { my_snprintf(buf[1], column_size, "*"); } else { const char *state = ""; Index: client/repodlgs_common.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/client/repodlgs_common.c,v retrieving revision 1.12 diff -u -r1.12 repodlgs_common.c --- client/repodlgs_common.c 29 Aug 2004 12:36:12 -0000 1.12 +++ client/repodlgs_common.c 1 Sep 2004 14:34:14 -0000 @@ -321,7 +321,7 @@ if (!pcity->did_sell && city_got_building(pcity, impr) && (!obsolete_only || improvement_obsolete(game.player_ptr, impr) - || wonder_replacement(pcity, impr))) { + || building_replaced(pcity, impr))) { count++; gold += impr_sell_gold(impr); city_sell_improvement(pcity, impr); Index: common/city.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/common/city.c,v retrieving revision 1.239 diff -u -r1.239 city.c --- common/city.c 31 Aug 2004 04:40:50 -0000 1.239 +++ common/city.c 1 Sep 2004 14:34:15 -0000 @@ -263,10 +263,10 @@ } /************************************************************************** - FIXME: This should be replaced in the near future with - improvment_redundant() + Returns TRUE if a building is replaced. To be replaced, all its effects + must be redundant. **************************************************************************/ -bool wonder_replacement(const struct city *pcity, Impr_Type_id id) +bool building_replaced(const struct city *pcity, Impr_Type_id id) { if(is_wonder(id)) return FALSE; switch (id) { @@ -1129,7 +1129,7 @@ **************************************************************************/ bool city_got_effect(const struct city *pcity, Impr_Type_id id) { - return city_got_building(pcity, id) || wonder_replacement(pcity, id); + return city_got_building(pcity, id) || building_replaced(pcity, id); } /************************************************************************** Index: common/city.h =================================================================== RCS file: /home/freeciv/CVS/freeciv/common/city.h,v retrieving revision 1.157 diff -u -r1.157 city.h --- common/city.h 14 Aug 2004 21:29:43 -0000 1.157 +++ common/city.h 1 Sep 2004 14:34:15 -0000 @@ -372,7 +372,7 @@ bool city_got_effect(const struct city *pcity, Impr_Type_id id); bool is_capital(const struct city *pcity); bool city_got_citywalls(const struct city *pcity); -bool wonder_replacement(const struct city *pcity, Impr_Type_id id); +bool building_replaced(const struct city *pcity, Impr_Type_id id); int city_change_production_penalty(const struct city *pcity, int target, bool is_unit); int city_turns_to_build(const struct city *pcity, int id, bool id_is_unit,
|