Fix possible boat crash
This commit is contained in:
parent
7ca094f4dd
commit
7e82b8f2ce
@ -105,7 +105,7 @@ local register_boat = function(name, def)
|
||||
if self._driver then
|
||||
if not self._driver:is_player() then
|
||||
self._driver = nil
|
||||
end
|
||||
else
|
||||
local ctrl = self._driver:get_player_control()
|
||||
if ctrl.left and not ctrl.right then
|
||||
yaw = yaw + YAW_CHANGE_RATE * dtime
|
||||
@ -122,6 +122,7 @@ local register_boat = function(name, def)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
local get_horvel = function(v, yaw)
|
||||
local x = -math.sin(yaw) * v
|
||||
local z = math.cos(yaw) * v
|
||||
|
Loading…
x
Reference in New Issue
Block a user