aboutsummaryrefslogtreecommitdiff
path: root/internal/game
diff options
context:
space:
mode:
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)))
}