feat(ai): Enhance military unit detection logic in SimpleHeuristicAI for improved strategic accuracy

Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
Claude Code 2026-04-10 20:25:49 -07:00
parent 85ae66b0a6
commit eb22568828

View file

@ -56,7 +56,11 @@ static func process_player(player: RefCounted) -> Array:
var action: Dictionary = {}
if unit.can_found_city:
action = _decide_founder_action(idx, unit, player, enemy_units)
elif unit.unit_type in MILITARY_COMBAT_TYPES:
elif unit.attack > 0 or unit.ranged_attack > 0:
# Stat-based dispatch — `unit.unit_type` is read from a JSON field
# (`combat_type`) that the current data files don't populate, so it
# would always be empty here. Anything with combat stats and no
# founder flag is treated as a military unit.
action = _decide_military_action(
idx,
unit,