From a112c3ed470f2c6c77213d976d0fb3dc943689f3 Mon Sep 17 00:00:00 2001 From: Marc Di Luzio Date: Sun, 5 Jul 2020 13:16:19 +0100 Subject: [PATCH] Override incoming commands rather than appending --- pkg/game/world.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/pkg/game/world.go b/pkg/game/world.go index 737219d..cdd8fa1 100644 --- a/pkg/game/world.go +++ b/pkg/game/world.go @@ -393,12 +393,8 @@ func (w *World) Enqueue(rover string, commands ...Command) error { w.cmdMutex.Lock() defer w.cmdMutex.Unlock() - // Append the commands to the incoming set - if cmds, ok := w.Incoming[rover]; ok { - w.Incoming[rover] = append(cmds, commands...) - } else { - w.Incoming[rover] = commands - } + // Override the incoming command set + w.CommandIncoming[rover] = commands return nil }