mirror of
https://github.com/minetest/minetest.git
synced 2025-03-06 20:48:40 +01:00
DevTest: Reject buggy "/hp inf" command (#12830)
This commit is contained in:
parent
22cbc05808
commit
b10d6542db
1 changed files with 1 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue