Skip to content

Commit

Permalink
Make sure that radius has sane value when actually used
Browse files Browse the repository at this point in the history
  • Loading branch information
SX authored and BuckarooBanzay committed Mar 1, 2020
1 parent e004a79 commit a8bf7ad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion common.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ end
-- get offset from meta
jumpdrive.get_radius = function(pos)
local meta = minetest.get_meta(pos);
return meta:get_int("radius")
return math.max(math.min(meta:get_int("radius"), jumpdrive.config.max_radius), 1)
end

-- calculates the power requirements for a jump
Expand Down

0 comments on commit a8bf7ad

Please sign in to comment.