From 5ad42a51df4dcc5ccc3aa6a6d902085ce2ee4239 Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Fri, 18 Sep 2026 18:08:01 -0400 Subject: fix: journal multi-file room/entity edits; simplify queued-position lookup --- internal/game/cmd_queued.go | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'internal/game/cmd_queued.go') 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))) } -- cgit v1.2.3