Fix WarpRover when warping onto itself

This commit is contained in:
Marc Di Luzio 2020-06-08 23:41:33 +01:00
parent de94b39a50
commit ae2cb6598a

View file

@ -146,6 +146,11 @@ func (w *World) WarpRover(id uuid.UUID, pos Vector) error {
defer w.worldMutex.Unlock()
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
// TODO: Make this (and other things) transactional
// TODO: Check this worldtile is free