forked from LizzyFleckenstein03/Memeclone
Remove unused and completely unlogical enchantment_level paramenter from get_possible_enchantments
This commit is contained in:
parent
261faafb7c
commit
882db9f873
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue