Override incoming commands rather than appending
This commit is contained in:
parent
233a6b3281
commit
a112c3ed47
1 changed files with 2 additions and 6 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue