reworks (thx dargkkast), more consistent lib functions, total item rework

This commit is contained in:
2025-03-31 21:38:37 +02:00
parent 773187ef20
commit 5df7dd64ed
17 changed files with 122 additions and 175 deletions

View File

@@ -1,9 +0,0 @@
import { getInventory, updateInventory } from "../lib/userHelper";
export async function changeLootboxCount(username: string, amount = -1): Promise<itemChangeResult> {
let inv = await getInventory(username)
if (amount < 0 && inv.lootbox+ amount < 0) return {result: false, count: inv.lootbox}
inv.lootbox += amount
await updateInventory(username, inv)
return {result: true, count: inv.lootbox}
}