mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-12-23 00:19:32 +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
|
if not supported then
|
||||||
return false, "item not supported"
|
return false, "item not supported"
|
||||||
end
|
end
|
||||||
if not level then
|
if not level or level < 0 then
|
||||||
return false, "level invalid"
|
return false, "level invalid"
|
||||||
end
|
end
|
||||||
if level > enchantment_def.max_level then
|
if level > enchantment_def.max_level then
|
||||||
|
|
Loading…
Reference in a new issue