Merge pull request 'ENTITIES/mcl_boats: Fix mob-in-boat crash in Minetest 5.5-dev' (#249) from fix-boat-crash-in-minetest-5.5-dev into master

Reviewed-on: https://git.minetest.land/Mineclonia/Mineclonia/pulls/249
Reviewed-by: cora <cora@noreply.git.minetest.land>
master
cora 2022-01-27 00:50:08 +00:00
commit 6abdbbbd13
1 changed files with 2 additions and 2 deletions

View File

@ -260,7 +260,7 @@ function boat.on_step(self, dtime, moveresult)
return
end
local yaw = self.object:get_yaw()
if ctrl.up then
if ctrl and ctrl.up then
-- Forwards
self._v = self._v + 0.1 * v_factor
@ -269,7 +269,7 @@ function boat.on_step(self, dtime, moveresult)
self.object:set_animation({x=0, y=40}, paddling_speed, 0, true)
self._animation = 1
end
elseif ctrl.down then
elseif ctrl and ctrl.down then
-- Backwards
self._v = self._v - 0.1 * v_factor