bugfix in movement - swimming in water without path did crashed the game
This commit is contained in:
parent
27945f0d87
commit
db73c503df
@ -199,7 +199,7 @@ function mvobj_proto:_do_movement_step(dtime)
|
||||
if string.find(node[0].name, "^default:water") or
|
||||
string.find(node[1].name, "^default:water") then
|
||||
-- we are under water. sink if target bellow the current position. otherwise swim up
|
||||
if not self._path[1] or self._path[1].y > self.pos.y then
|
||||
if not self._path or not self._path[1] or self._path[1].y > self.pos.y then
|
||||
self.velocity.y = 3
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user