[Freeciv-tickets] [freeciv] #46069: Clean up AI defense building code

Back to archive index
OSDN Ticket System norep****@osdn*****
Tue Dec 13 20:26:40 JST 2022


#46069: Clean up AI defense building code

  Open Date: 2022-11-15 19:38
Last Update: 2022-12-13 14:26

URL for this Ticket:
    https://osdn.net//projects/freeciv/ticket/46069
RSS feed for this Ticket:
    https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=46069

---------------------------------------------------------------------

Last Changes/Comment on this Ticket:
2022-12-13 14:26 Updated by: ihnatus

Comment:

Reply To cazfi
Has city_got_defense_effect() changed to do the checking with "Certain"?
Has it ever been different? It uses, underlyingly, get_target_bonus_effects() that evaluates to RPT_CERTAIN.

---------------------------------------------------------------------
Ticket Status:

      Reporter: ihnatus
         Owner: (None)
          Type: Bugs
        Status: Open
      Priority: 5 - Medium
     MileStone: (None)
     Component: AI
      Severity: 5 - Medium
    Resolution: None
---------------------------------------------------------------------

Ticket details:

More a meta-task related to HRM923112 and #45592, maybe I have missed some more tickets. Just some code location2s seem totally unworking. In autogames, I see whole continents conquered by a handful of barbarians because tbe cities are too busy building libraries or too failed to upkeep a lame warrior. Now, one of places that I'm almost sure does not work, dai_process_defender_want in daimilitary.c:
  bool walls = city_got_defense_effect(pcity, NULL);
Since defense effects are mostly unit class related, we get FALSE here.
  int limit_cost = pcity->shield_stock + 40;
//...
&& limit_cost <= pcity->shield_stock + 40
This variable is not modified, some redundant check.
Also, I have already noticed some stange treatment of UTYF_BADCITYDEFENDER across the code.

-- 
Ticket information of Freeciv project
Freeciv Project is hosted on OSDN

Project URL: https://osdn.net/projects/freeciv/
OSDN: https://osdn.net

URL for this Ticket:
    https://osdn.net/projects/freeciv/ticket/46069
RSS feed for this Ticket:
    https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=46069



More information about the Freeciv-tickets mailing list
Back to archive index