Module:ItemData: Difference between revisions

removed "is Disabled" check for get_json_item and get_codename
One Bar (talk | contribs)
Components no longer add to total item cost
Line 46: Line 46:
local item = get_json_item(item_name)
local item = get_json_item(item_name)
if(item == nil) then return "<span style=\"color:red;\">Item Not Found.</span>" end
if(item == nil) then return "<span style=\"color:red;\">Item Not Found.</span>" end
return item["Cost"]
local cost = 0
local cur_item = item
repeat
cost = cost + cur_item["Cost"]
if(cur_item["Components"] == nil) then
break
end
cur_item = data[cur_item["Components"][1]]
until cur_item == nil
 
return cost
end
end