From bd6362cb92c9105a36ed900cfbaafa2b2ee81ab8 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Wed, 6 Aug 2025 09:35:57 +0200 Subject: recheck the source position each time This allows the reuse of the targets. --- go/game/targets.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/go/game/targets.go b/go/game/targets.go index a7e89740..61cf3436 100644 --- a/go/game/targets.go +++ b/go/game/targets.go @@ -480,9 +480,8 @@ func posFromTileOrPermanent(tileOrPermanent any) Position { } func rangeTargetConstraint(source any, r int) TargetConstraintFunc { - sourcePos := posFromTileOrPermanent(source) - return func(t any) (err error) { + sourcePos := posFromTileOrPermanent(source) targetPos := posFromTileOrPermanent(t) if !IsPositionInRange(sourcePos, targetPos, r) { err = fmt.Errorf("Position %v of target %v not in range %d of source's position %v", -- cgit v1.2.3