Fix WarpRover when warping onto itself
This commit is contained in:
parent
de94b39a50
commit
ae2cb6598a
1 changed files with 5 additions and 0 deletions
|
@ -146,6 +146,11 @@ func (w *World) WarpRover(id uuid.UUID, pos Vector) error {
|
||||||
defer w.worldMutex.Unlock()
|
defer w.worldMutex.Unlock()
|
||||||
|
|
||||||
if i, ok := w.Rovers[id]; ok {
|
if i, ok := w.Rovers[id]; ok {
|
||||||
|
// Nothing to do if these positions match
|
||||||
|
if i.Attributes.Pos == pos {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
// Update the world tile
|
// Update the world tile
|
||||||
// TODO: Make this (and other things) transactional
|
// TODO: Make this (and other things) transactional
|
||||||
// TODO: Check this worldtile is free
|
// TODO: Check this worldtile is free
|
||||||
|
|
Loading…
Add table
Reference in a new issue