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

アーカイブの一覧に戻る
OSDN Ticket System norep****@osdn*****
Sat Dec 10 13:59:50 JST 2022


#46069: Clean up AI defense building code

  Open Date: 2022-11-15 18:38
Last Update: 2022-12-10 06:59

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-10 06:59 Updated by: cazfi

Comment:

Reply To ihnatus
{{{
  bool walls = city_got_defense_effect(pcity, NULL);
}}}
Since defense effects are mostly unit class related, we get FALSE here.
Has city_got_defense_effect() changed to do the checking with "Certain"? I think the problem here used to be that it could not tell Coastal Defense apart from City Walls, and some comments still refer to that.

---------------------------------------------------------------------
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
アーカイブの一覧に戻る