aboutsummaryrefslogtreecommitdiff
path: root/internal/game/cmd_queued.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/game/cmd_queued.go')
-rw-r--r--internal/game/cmd_queued.go11
1 files changed, 4 insertions, 7 deletions
diff --git a/internal/game/cmd_queued.go b/internal/game/cmd_queued.go
index 303a3ec..dcda825 100644
--- a/internal/game/cmd_queued.go
+++ b/internal/game/cmd_queued.go
@@ -14,10 +14,10 @@ func (g *Game) executeQueued(sess *net.Session, args []string, rawInput string)
func (g *Game) doQueued(sess *net.Session) {
p := sess.Player
- freeCmds := g.freeQueue[p.Name]
- activeCmd := g.activeQueue[p.Name]
+ freeCmds := g.queue.PeekFree(p.Name)
+ activeCmd, hasActive := g.queue.PeekActive(p.Name)
- if len(freeCmds) == 0 && activeCmd == nil {
+ if len(freeCmds) == 0 && !hasActive {
sess.WriteLine("No actions queued.")
return
}
@@ -51,10 +51,7 @@ func (g *Game) doQueued(sess *net.Session) {
sess.WriteLine(fmt.Sprintf(" All queued actions take effect on the next game tick (600ms)."))
sess.WriteLine(fmt.Sprintf(" Free actions stack. Only the most recent active action survives."))
- var names []string
- for name := range g.activeQueue {
- names = append(names, name)
- }
+ names, _ := g.queue.ActivePositions(p.Name)
sort.Strings(names)
pos := 0
for i, name := range names {