aboutsummaryrefslogtreecommitdiff
path: root/order.go
diff options
context:
space:
mode:
authorMartin Kagamino Lehoux <martin@lehoux.net>2023-10-02 22:03:25 +0200
committerMartin Kagamino Lehoux <martin@lehoux.net>2023-10-02 22:03:25 +0200
commit7e80b9cc8535973be68a1444843ecfc81d3ff355 (patch)
tree043c1901e25b00268f7aded60f6c2b9d4a70a6f7 /order.go
parent129d4d173b7c55e7a24ed49c2f50b50c56192253 (diff)
fix(move): Keep current path during move if it still applies
Diffstat (limited to 'order.go')
-rw-r--r--order.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/order.go b/order.go
index 13c1b09..6836954 100644
--- a/order.go
+++ b/order.go
@@ -1,6 +1,8 @@
package main
-import "golang.org/x/exp/slog"
+import (
+ "golang.org/x/exp/slog"
+)
type Order interface {
Update(e *Entity, g *Game)
@@ -36,7 +38,7 @@ func Patrol(e *Entity, destination Point) Order {
if e.Selection.IsEnabled && e.Position.IsEnabled && e.Move.IsEnabled && e.Order.IsEnabled {
if e.Selection.Value.IsSelected {
origin := e.Position.Value
- slog.Info("patroling between", slog.String("origin", origin.String()), slog.String("destination", destination.String()))
+ slog.Info("patrolling between", slog.String("origin", origin.String()), slog.String("destination", destination.String()))
e.Order.Value = &PatrolOrder{origin: origin, destination: destination}
}
}