Summary: When gold_upkeep_style = 2, building upkeep not
taken into account for taxes 
                 Project: Freeciv
            Submitted by: bardo
            Submitted on: mié 12 feb 2014 06:26:21 UTC
                Category: ai
                Severity: 3 - Normal
                Priority: 5 - Normal
                  Status: None
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
                 Release: all
         Discussion Lock: Any
        Operating System: None
         Planned Release: 



When gold_upkeep_style = 2, AI does not take into account the upkeep of
Buildings when they decide the tax rates.

I knew there was something wrong with gold_upkeep_style for long time, but I
was unable to debug the code until now, and finally I found the exact cause.

Related code in aihand.c:

  /* Find total trade surplus and gold expenses */
  city_list_iterate(pplayer->cities, pcity) {
    if (NULL != trade) {
      *trade += pcity->surplus[O_TRADE];

    if (NULL != expenses) {
      *expenses += pcity->usage[O_GOLD];

    if (NULL != income) {
      *income += pcity->surplus[O_GOLD];
  } city_list_iterate_end;

  if (game.info.gold_upkeep_style > 0) {
    /* Account for units with gold upkeep paid for by the nation.
     * (game.info.gold_upkeep_style = 1 & 2) */
    unit_list_iterate(pplayer->units, punit) {
      *expenses += punit->upkeep[O_GOLD];
    } unit_list_iterate_end;

Latest time that I reported this bug, someone added the part to sum the
expenses due to upkeep of units, but we forgot to sum the upkeep of buildings
for game.info.gold_upkeep_style = 2, because in this case they are not
included in city expenses.

You can verify by watching the value of variable "expenses" in game. I do not
know the code enough to create a patch.


Reply to this item at:


  Mensaje enviado vía/por Gna!

Freeciv-dev mailing list

Reply via email to