2,875
edits
No edit summary |
No edit summary |
||
Line 23: | Line 23: | ||
-- Prevents external modules from having to make GameData and Common calls. | -- Prevents external modules from having to make GameData and Common calls. | ||
function p.getCategoryPurchases(checkFunc, category) | function p.getCategoryPurchases(checkFunc, category) | ||
local | local shopCat = GameData.getEntityByName('shopCategories', category) | ||
if shopCat == nil then | if shopCat == nil then | ||
return Shared.printError('Invalid category ' .. | return Shared.printError('Invalid category ' .. shopCat) | ||
end | end | ||
Line 32: | Line 32: | ||
local func = | local func = | ||
function(purchase) | function(purchase) | ||
if purchase.category ~= shopCat.id then | |||
return false | |||
end | |||
local name = Common.getPurchaseName(purchase) | local name = Common.getPurchaseName(purchase) | ||
return checkFunc(purchase, name) | return checkFunc(purchase, name) |
edits