Skip to content

Commit

Permalink
Allow movestone to relmove in negative directions (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
LminusSucksAtCoding authored Jan 4, 2024
1 parent 0b76475 commit 2082081
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions movestone.lua
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,9 @@ minetest.register_node("digistuff:movestone", {
if type(msg.x) ~= "number" then msg.x = 0 end
if type(msg.y) ~= "number" then msg.y = 0 end
if type(msg.z) ~= "number" then msg.z = 0 end
msg.x = pos.x+math.max(0,math.min(50,math.floor(msg.x)))
msg.y = pos.y+math.max(0,math.min(50,math.floor(msg.y)))
msg.z = pos.z+math.max(0,math.min(50,math.floor(msg.z)))
msg.x = pos.x+math.max(-50,math.min(50,math.floor(msg.x)))
msg.y = pos.y+math.max(-50,math.min(50,math.floor(msg.y)))
msg.z = pos.z+math.max(-50,math.min(50,math.floor(msg.z)))
local firstaxis
if msg.x ~= pos.x then firstaxis = "x"
elseif msg.y ~= pos.y then firstaxis = "y"
Expand Down

0 comments on commit 2082081

Please sign in to comment.