From 9175de76012680eb10807380c64156a723d48fae Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Thu, 24 Jul 2025 05:28:56 -0400 Subject: panic if unit ai posts a nil action --- go/game/ai.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/go/game/ai.go b/go/game/ai.go index 07440899..abdebba4 100644 --- a/go/game/ai.go +++ b/go/game/ai.go @@ -577,7 +577,6 @@ func TargetOrientedAI(ai *UnitAI) { // If there is no special case for a unit, a rough heuristic is used to determinw the AI. // Units with full actions are shy and everything else is aggresive. func SuggestUnitAI(unit *Unit) string { - log.Println(unit.card.Name) switch unit.card.Name { case "King": return "shy" @@ -660,6 +659,9 @@ func (ai *SimpleAiControl) handlePriority() Action { u.tap() continue } + if a == nil && more { + log.Fatal(uAi, "returned a nil action") + } return a } } -- cgit v1.2.3