From aef4d5ea938f55831e70e28ae2a19c1b23797d8a Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Tue, 26 Mar 2024 20:36:22 +0100 Subject: only generate ArtifactMoveActions if the switched positions are suitable --- go/game/unit.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'go/game/unit.go') diff --git a/go/game/unit.go b/go/game/unit.go index c875fa50..9f823a0d 100644 --- a/go/game/unit.go +++ b/go/game/unit.go @@ -172,7 +172,10 @@ func (u *Unit) AvailSlowActions() (actions []Action) { } for _, t := range TilesInRange(m, u, 1) { - if t.Permanent != nil && t.Permanent.Card().Type.IsArtifact() { + // Only generate a ArtifactSwitchAction if the tiles are current + // tiles are suitable for both permanents + if t.Permanent != nil && t.Permanent.Card().Type.IsArtifact() && + t.IsSuitableForCard(u.Card()) && u.Tile().IsSuitableForCard(t.Permanent.Card()) { actions = append(actions, newArtifactSwitchAction(u, t.Permanent)) } } -- cgit v1.2.3