Skip to content

Commit

Permalink
commit missing section
Browse files Browse the repository at this point in the history
  • Loading branch information
SwissalpS committed Apr 13, 2024
1 parent e7581da commit 19e2d54
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -393,8 +393,14 @@ local on_step = function(self, dtime, moveresult)
return
end

if mouse_controls then
rot.x = rot.x + (-driver:get_look_vertical() - rot.x) * dtime * 2
local mouse, inverted = player_controls(driver)
if mouse then
local ver = driver:get_look_vertical()
if inverted then
rot.x = rot.x + (-ver - rot.x) * dtime * 2
else
rot.x = rot.x + (ver - rot.x) * dtime * 2
end
local hor = driver:get_look_horizontal()
local angle = hor - rot.y
if angle < -math_pi then
Expand Down

0 comments on commit 19e2d54

Please sign in to comment.