diff options
author | Wuzzy <Wuzzy@disroot.org> | 2022-10-03 18:13:23 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-03 12:13:23 -0400 |
commit | b10d6542db09d427bc263ea935c29846821cee62 (patch) | |
tree | 1ed2b9af1b833e4619cdc6c696e32cb8e638b93b /games/devtest/mods/util_commands/init.lua | |
parent | 22cbc058080127445b69d2137e346ad52f8b3387 (diff) | |
download | minetest-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.lua | 2 |
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) |