Skip to content

Commit

Permalink
DevTest: Reject buggy "/hp inf" command (minetest#12830)
Browse files Browse the repository at this point in the history
  • Loading branch information
Wuzzy2 committed Oct 3, 2022
1 parent 22cbc05 commit b10d654
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion games/devtest/mods/util_commands/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ minetest.register_chatcommand("hp", {
return false, "No player."
end
local hp = tonumber(param)
if not hp then
if not hp or minetest.is_nan(hp) or hp < 0 or hp > 65535 then
return false, "Missing or incorrect hp parameter!"
end
player:set_hp(hp)
Expand Down

0 comments on commit b10d654

Please sign in to comment.