aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorMartin Kagamino Lehoux <martin@lehoux.net>2025-07-25 11:49:42 +0200
committerMartin Kagamino Lehoux <martin@lehoux.net>2025-07-25 11:49:42 +0200
commit87563d8bbf70cba9443435113a8bddfcd39f611d (patch)
treed0d98265f0552791e6459af99366f3658502788d /main.go
parent563b9ee704a14322ed4805896c4f8ca3fa5df03a (diff)
refactor: ECS patrol order
Diffstat (limited to 'main.go')
-rw-r--r--main.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/main.go b/main.go
index 3d014bf..86dc59b 100644
--- a/main.go
+++ b/main.go
@@ -103,7 +103,9 @@ func (g *Game) updatePatrolling(cursor physics.Point) {
if inpututil.IsMouseButtonJustReleased(ebiten.MouseButtonRight) {
destination := cursor.Div(100).Mul(100)
for _, e := range g.Entities {
- Patrol(e, destination)
+ if e.Selection.IsEnabled && e.Selection.Value.IsSelected {
+ Patrol(e.Position, e.Move, &e.Order, destination)
+ }
}
g.CurrentAction = Selecting
}