From b10d6542db09d427bc263ea935c29846821cee62 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Mon, 3 Oct 2022 18:13:23 +0200 Subject: [PATCH] DevTest: Reject buggy "/hp inf" command (#12830) --- games/devtest/mods/util_commands/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)