mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-12-22 16:09:33 +01:00
Treat negative enchantment levels as invalid (#4735)
Reviewed-on: https://git.minetest.land/VoxeLibre/VoxeLibre/pulls/4735 Reviewed-by: kno10 <kno10@noreply.git.minetest.land> Co-authored-by: Mikita Wiśniewski <rudzik8@protonmail.com> Co-committed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
This commit is contained in:
parent
e42a863d92
commit
dec332c822
1 changed files with 1 additions and 1 deletions
|
@ -137,7 +137,7 @@ function mcl_enchanting.can_enchant(itemstack, enchantment, level)
|
|||
if not supported then
|
||||
return false, "item not supported"
|
||||
end
|
||||
if not level then
|
||||
if not level or level < 0 then
|
||||
return false, "level invalid"
|
||||
end
|
||||
if level > enchantment_def.max_level then
|
||||
|
|
Loading…
Reference in a new issue