Skip to content

Commit

Permalink
Fix bug that would allow player to move slightly if clicking on the char
Browse files Browse the repository at this point in the history
  • Loading branch information
mathielo committed Dec 10, 2017
1 parent a03782b commit 5736e84
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion workshop/modinfo.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ description = "Makes it possible to disable the walk by clicking action in the g
author = "machete_kills"

--A version number so you can ask people if they are running an old version of your mod.
version = "0.2.0"
version = "0.2.1"

--This lets other players know if your mod is out of date. This typically needs to be updated every time there's a new game update.
api_version = 6
Expand Down
4 changes: 3 additions & 1 deletion workshop/modmain.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ local PlayerControllerPostConstruct = function(self)
-- Only intercept if "down" and also if nothing is being placed
if down and (self.placer_recipe == nil or self.placer == nil) then
local act = self:GetLeftMouseAction() or BufferedAction(self.inst, nil, ACTIONS.WALKTO, nil, TheInput:GetWorldPosition())
if not CLICK_TO_WALK_ENABLED and act.action == ACTIONS.WALKTO and act.target == nil and TheInput:GetWorldEntityUnderMouse() == nil then
local mouseEntity = TheInput:GetWorldEntityUnderMouse()
local mousePointsAtPlayerOrNil = mouseEntity == nil or mouseEntity == self.inst
if not CLICK_TO_WALK_ENABLED and act.action == ACTIONS.WALKTO and act.target == nil and mousePointsAtPlayerOrNil then
return
end
end
Expand Down

0 comments on commit 5736e84

Please sign in to comment.