aboutsummaryrefslogtreecommitdiff
path: root/games/devtest/mods/util_commands/init.lua
diff options
context:
space:
mode:
authorWuzzy <Wuzzy@disroot.org>2022-10-03 18:13:23 +0200
committerGitHub <noreply@github.com>2022-10-03 12:13:23 -0400
commitb10d6542db09d427bc263ea935c29846821cee62 (patch)
tree1ed2b9af1b833e4619cdc6c696e32cb8e638b93b /games/devtest/mods/util_commands/init.lua
parent22cbc058080127445b69d2137e346ad52f8b3387 (diff)
downloadminetest-b10d6542db09d427bc263ea935c29846821cee62.tar.xz
DevTest: Reject buggy "/hp inf" command (#12830)
Diffstat (limited to 'games/devtest/mods/util_commands/init.lua')
-rw-r--r--games/devtest/mods/util_commands/init.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/games/devtest/mods/util_commands/init.lua b/games/devtest/mods/util_commands/init.lua
index c37364042..4f80172c6 100644
--- a/games/devtest/mods/util_commands/init.lua
+++ b/games/devtest/mods/util_commands/init.lua
@@ -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)