refactorings

This commit is contained in:
Manuel Simon Hirsig
2016-08-03 19:56:49 +02:00
parent b374c7946f
commit 9da474c616
7 changed files with 223 additions and 240 deletions
+4 -4
View File
@@ -36,7 +36,7 @@ do
}
function public.source(item_id)
return data[item_id] and unpack(data[item_id])
return unpack(data[item_id] or {})
end
end
@@ -84,14 +84,14 @@ function public.value(slot, quality, level)
end
function public.distribution(slot, quality, level)
if not (m.armor[slot] or m.weapon[slot]) or level == 0 then
if not (m.armor(slot) or m.weapon(slot)) or level == 0 then
return {}
end
local function p(probability_armor, probability_weapon)
if m.armor[slot] then
if m.armor(slot) then
return probability_armor
elseif m.weapon[slot] then
elseif m.weapon(slot) then
return probability_weapon
end
end