1
0
Fork 0

Remove unused and completely unlogical enchantment_level paramenter from get_possible_enchantments

This commit is contained in:
Lizzy Fleckenstein 2021-12-07 15:49:12 +01:00
parent 261faafb7c
commit 882db9f873
Signed by untrusted user: LizzyFleckenstein03
GPG Key ID: 06927A5199D6C9B2
1 changed files with 2 additions and 2 deletions

View File

@ -295,7 +295,7 @@ function mcl_enchanting.initialize()
end end
end end
function mcl_enchanting.get_possible_enchantments(itemstack, enchantment_level, treasure) function mcl_enchanting.get_possible_enchantments(itemstack, treasure)
local possible_enchantments, weights, accum_weight = {}, {}, 0 local possible_enchantments, weights, accum_weight = {}, {}, 0
for enchantment, enchantment_def in pairs(mcl_enchanting.enchantments) do for enchantment, enchantment_def in pairs(mcl_enchanting.enchantments) do
local can_enchant, _, _, primary = mcl_enchanting.can_enchant(itemstack, enchantment, 1) local can_enchant, _, _, primary = mcl_enchanting.can_enchant(itemstack, enchantment, 1)
@ -327,7 +327,7 @@ function mcl_enchanting.generate_random_enchantments(itemstack, enchantment_leve
if enchantment_level == 0 then if enchantment_level == 0 then
break break
end end
local possible, weights, accum_weight = mcl_enchanting.get_possible_enchantments(itemstack, enchantment_level, treasure) local possible, weights, accum_weight = mcl_enchanting.get_possible_enchantments(itemstack, treasure)
local selected_enchantment, enchantment_power local selected_enchantment, enchantment_power
if #possible > 0 then if #possible > 0 then
local r = math.random(accum_weight) local r = math.random(accum_weight)