improve: purchases #161
@ -27,7 +27,7 @@ export const inventorySlotsController: RequestHandler = async (req, res) => {
|
||||
|
||||
//TODO: check which slot was purchased because pvpBonus is also possible
|
||||
|
||||
const currencyChanges = await updateCurrency(-20, true, accountId);
|
||||
const currencyChanges = await updateCurrency(20, true, accountId);
|
||||
await updateSlots(accountId, SlotNameToInventoryName.LOADOUT, 1, 1);
|
||||
|
||||
//console.log({ InventoryChanges: currencyChanges }, " added loadout changes:");
|
||||
|
@ -97,11 +97,11 @@ export const updateCurrency = async (price: number, usePremium: boolean, account
|
||||
|
||||
if (usePremium) {
|
||||
if (inventory.PremiumCreditsFree > 0) {
|
||||
inventory.PremiumCreditsFree += price;
|
||||
inventory.PremiumCreditsFree -= price;
|
||||
}
|
||||
inventory.PremiumCredits += price;
|
||||
inventory.PremiumCredits -= price;
|
||||
} else {
|
||||
inventory.RegularCredits += price;
|
||||
inventory.RegularCredits -= price;
|
||||
}
|
||||
|
||||
const modifiedPaths = inventory.modifiedPaths();
|
||||
|
Loading…
x
Reference in New Issue
Block a user