Project

General

Profile

Actions

Bug #2457

open

ai: buys barracks before defenders

Added by Sweet Tea Dorminy 3 days ago. Updated 3 days ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
AI
Target version:
-
Start date:
11/08/2026
Due date:
% Done:

0%

Estimated time:

Description

adjust_ai_unit_choice() in daimilitary.c turns any non-veteran military unit choice into the building that grants veterancy, if it can. It never looks at the city to see if there's an actual defender...

The walls path a few lines down refuses to build walls before the first defender ("Walls will help nothing if there's nobody behind them"); but the same is true for barracks.

Patch keeps the unit when no defender of ours stands in the city.


Files

Actions

Also available in: Atom PDF