aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--go/game/ai.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/go/game/ai.go b/go/game/ai.go
index f630b41b..928285bc 100644
--- a/go/game/ai.go
+++ b/go/game/ai.go
@@ -652,7 +652,13 @@ func (ai *SimpleAiControl) handlePriority() Action {
// Slow Actions
if s.stack.IsEmpty() {
for _, u := range s.OwnUnits(ai.p) {
- if len(u.AvailSlowActions()) == 0 {
+ as := u.AvailSlowActions()
+ if len(as) == 0 {
+ delete(ai.uAis, u)
+ continue
+ } else if _, ok := as[0].(*StreetAction); ok && len(as) == 1 {
+ // FIXME: Support Street Actions
+ delete(ai.uAis, u)
continue
}
@@ -667,6 +673,8 @@ func (ai *SimpleAiControl) handlePriority() Action {
if !more {
// Consume all available actions to not consider the unit this term again.
u.tap()
+ // Delete unitAI if it finished its turn
+ delete(ai.uAis, u)
continue
}
if a == nil && more {