aboutsummaryrefslogtreecommitdiff
path: root/internal/game
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-09-18 18:08:01 -0400
committerhistoria <[not public]>2026-09-18 18:08:01 -0400
commit5ad42a51df4dcc5ccc3aa6a6d902085ce2ee4239 (patch)
tree055c826299d4f10b38ca423920aef5af14969906 /internal/game
parent8fe9e3c3fef0049df82281a62afe35dda516dfe2 (diff)
downloadthehouseoficarus-5ad42a51df4dcc5ccc3aa6a6d902085ce2ee4239.tar.gz
fix: journal multi-file room/entity edits; simplify queued-position lookup
Diffstat (limited to 'internal/game')
-rw-r--r--internal/game/cmd_queued.go13
1 files changed, 3 insertions, 10 deletions
diff --git a/internal/game/cmd_queued.go b/internal/game/cmd_queued.go
index 7ac05a6..5f43ad1 100644
--- a/internal/game/cmd_queued.go
+++ b/internal/game/cmd_queued.go
@@ -2,7 +2,6 @@ package game
import (
"fmt"
- "sort"
"thehouseoficarus/internal/net"
)
@@ -51,15 +50,9 @@ func (g *Game) doQueued(sess *net.Session) {
sess.WriteLine(" All queued actions take effect on the next game tick (600ms).")
sess.WriteLine(" Free actions stack. Only the most recent active action survives.")
- names, _ := g.queue.ActivePositions(p.Name)
- sort.Strings(names)
- pos := 0
- for i, name := range names {
- if name == p.Name {
- pos = i + 1
- break
- }
- }
+ // ActivePositions already returns the names sorted and the caller's
+ // 1-based position, so there is nothing to recompute here.
+ names, pos := g.queue.ActivePositions(p.Name)
if pos > 0 && len(names) > 1 {
sess.WriteLine(fmt.Sprintf(" Your active action will resolve as queue position #%d of %d.", pos, len(names)))
}