Module:ItemData: Difference between revisionsGive feedback
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| Line 18: | Line 18: | ||
if(item == nil) then return "Item Not Found" end | if(item == nil) then return "Item Not Found" end | ||
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 | ||