chore: fix ISlots

This commit is contained in:
Sainan 2025-02-26 06:00:40 +01:00
parent 28a36052d9
commit 5ce2e26683
2 changed files with 3 additions and 4 deletions

View File

@ -668,9 +668,8 @@ export const updateSlots = (
extraAmount: number
): void => {
inventory[slotName].Slots += slotAmount;
if (inventory[slotName].Extra === undefined) {
inventory[slotName].Extra = extraAmount;
} else {
if (extraAmount != 0) {
inventory[slotName].Extra ??= 0;
inventory[slotName].Extra += extraAmount;
}
};

View File

@ -435,7 +435,7 @@ export enum InventorySlot {
}
export interface ISlots {
Extra: number; // can be undefined, but not if used via mongoose
Extra?: number;
Slots: number;
}