<URL: http://bugs.freeciv.org/Ticket/Display.html?id=40763 >
if the upkeep for all units is calculated each turn, this information can be used for the economic report depends on ticket 40619, 40759 compile tested and also with a short game
diff -ur freeciv-2.1.99svn15584.gold4/client/repodlgs_common.c freeciv-2.1.99svn15584.gold5//client/repodlgs_common.c --- freeciv-2.1.99svn15584.gold4/client/repodlgs_common.c 2009-04-11 20:18:01.000000000 +0200 +++ freeciv-2.1.99svn15584.gold5//client/repodlgs_common.c 2009-04-11 20:20:16.000000000 +0200 @@ -113,7 +113,6 @@ int *num_entries_used, int *total_cost) { int count, cost, partial_cost; - int free_upkeep[O_COUNT]; *num_entries_used = 0; *total_cost = 0; @@ -121,7 +120,6 @@ if (NULL == client.conn.playing) { return; } - memset(free_upkeep, 0, O_COUNT * sizeof(*free_upkeep)); unit_type_iterate(unittype) { cost = utype_upkeep_cost(unittype, client.conn.playing, O_GOLD); @@ -135,17 +133,10 @@ partial_cost = 0; city_list_iterate(client.conn.playing->cities, pcity) { - free_upkeep[O_GOLD] = get_city_output_bonus(pcity, get_output_type(O_GOLD), - EFT_UNIT_UPKEEP_FREE_PER_CITY); - unit_list_iterate(pcity->units_supported, punit) { - int upkeep_cost[O_COUNT]; - - city_unit_upkeep(punit, upkeep_cost, free_upkeep); - if (unit_type(punit) == unittype) { count++; - partial_cost += upkeep_cost[O_GOLD]; + partial_cost += punit->upkeep[O_GOLD]; } } unit_list_iterate_end;
_______________________________________________ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev