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 extraAmount: number
): void => { ): void => {
inventory[slotName].Slots += slotAmount; inventory[slotName].Slots += slotAmount;
if (inventory[slotName].Extra === undefined) { if (extraAmount != 0) {
inventory[slotName].Extra = extraAmount; inventory[slotName].Extra ??= 0;
} else {
inventory[slotName].Extra += extraAmount; inventory[slotName].Extra += extraAmount;
} }
}; };

View File

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