Fix boat behavior a bit when falling on water

This commit is contained in:
Wuzzy 2019-09-11 12:50:58 +02:00
parent df7acfc8ae
commit e633f15eed

View file

@ -248,11 +248,8 @@ function boat.on_step(self, dtime)
else else
-- On top of water -- On top of water
new_acce = {x = 0, y = 0, z = 0} new_acce = {x = 0, y = 0, z = 0}
if math.abs(self.object:get_velocity().y) < 1 then if math.abs(self.object:get_velocity().y) < 0 then
local pos = self.object:get_pos()
pos.y = math.floor(pos.y) + boat_y_offset
new_velo = get_velocity(self._v, self.object:get_yaw(), 0) new_velo = get_velocity(self._v, self.object:get_yaw(), 0)
self.object:set_pos(pos)
else else
new_velo = get_velocity(self._v, self.object:get_yaw(), new_velo = get_velocity(self._v, self.object:get_yaw(),
self.object:get_velocity().y) self.object:get_velocity().y)