2,869
edits
No edit summary |
No edit summary |
||
Line 89: | Line 89: | ||
local courseItemCosts = {} | local courseItemCosts = {} | ||
for _, | for _, obstacle in pairs(courseObstacles) do | ||
-- Pool together highest level requirements for the entire course. | -- Pool together highest level requirements for the entire course. | ||
for skill, level in pairs( | for skill, level in pairs(obstacle.LevelRequirements) do | ||
Shared.addOrUpdate(courseLevelRequirements, skill, | Shared.addOrUpdate(courseLevelRequirements, skill, | ||
function(x) | function(x) | ||
Line 99: | Line 99: | ||
-- Pool together total item costs to build the entire course course. | -- Pool together total item costs to build the entire course course. | ||
local | local obstacleCosts = obstacle.ItemCosts | ||
funcPoolCosts(courseItemCosts, 'GP', | if obstacleCosts['GP'] then funcPoolCosts(courseItemCosts, 'GP', obstacleCosts['GP']) end | ||
funcPoolCosts(courseItemCosts, 'SC', | if obstacleCosts['GP'] then funcPoolCosts(courseItemCosts, 'SC', obstacleCosts['SC']) end | ||
for item, amount in pairs( | for item, amount in pairs(obstacleCosts['Items']) do | ||
funcPoolCosts(courseItemCosts, item, amount) | funcPoolCosts(courseItemCosts, item, amount) | ||
end | end |
edits