diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2025-08-06 09:35:57 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2025-08-06 09:35:57 +0200 |
| commit | bd6362cb92c9105a36ed900cfbaafa2b2ee81ab8 (patch) | |
| tree | fa6542e34e46e73381fd74ee7bd4140267884d95 | |
| parent | 8aedaa204ced2eec921af6d1c28df5cbf8593363 (diff) | |
| download | muhqs-game-bd6362cb92c9105a36ed900cfbaafa2b2ee81ab8.tar.gz muhqs-game-bd6362cb92c9105a36ed900cfbaafa2b2ee81ab8.zip | |
recheck the source position each time
This allows the reuse of the targets.
| -rw-r--r-- | go/game/targets.go | 3 |
1 files changed, 1 insertions, 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", |
