Skip to content

Commit

Permalink
Use more precise InputMouseApply instead of StartCommand as a `Mo…
Browse files Browse the repository at this point in the history
…useMoved` hook (#1594)
  • Loading branch information
adamnejm authored Jan 8, 2024
1 parent 066544f commit ee3a9ea
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lua/starfall/libs_sh/input.lua
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,8 @@ SF.hookAdd("PlayerButtonUp", "inputreleased", CheckButtonPerms)
-- @class hook
-- @param number x X coordinate moved
-- @param number y Y coordinate moved
SF.hookAdd("StartCommand", "mousemoved", function(instance, ply, cmd)
SF.hookAdd("InputMouseApply", "mousemoved", function(instance, _, x, y)
if haspermission(instance, nil, "input") then
local x, y = cmd:GetMouseX(), cmd:GetMouseY()
if x~=0 or y~=0 then
return true, { x, y }
end
Expand Down

0 comments on commit ee3a9ea

Please sign in to comment.