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()
|
w.cmdMutex.Lock()
|
||||||
defer w.cmdMutex.Unlock()
|
defer w.cmdMutex.Unlock()
|
||||||
|
|
||||||
// Append the commands to the incoming set
|
// Override the incoming command set
|
||||||
if cmds, ok := w.Incoming[rover]; ok {
|
w.CommandIncoming[rover] = commands
|
||||||
w.Incoming[rover] = append(cmds, commands...)
|
|
||||||
} else {
|
|
||||||
w.Incoming[rover] = commands
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue