fix: refuse to give starting gear again (#1993)
Some checks failed
Build / build (push) Has been cancelled
Build Docker image / docker (push) Has been cancelled

Reviewed-on: #1993
Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com>
Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
This commit is contained in:
Sainan 2025-05-06 19:04:22 -07:00 committed by Sainan
parent 005690daa4
commit 203b3e20d9

View File

@ -149,6 +149,11 @@ export const addStartingGear = async (
inventory: TInventoryDatabaseDocument,
startingGear?: TPartialStartingGear
): Promise<IInventoryChanges> => {
if (inventory.ReceivedStartingGear) {
throw new Error(`account has already received starting gear`);
}
inventory.ReceivedStartingGear = true;
const { LongGuns, Pistols, Suits, Melee } = startingGear || {
LongGuns: [{ ItemType: "/Lotus/Weapons/Tenno/Rifle/Rifle" }],
Pistols: [{ ItemType: "/Lotus/Weapons/Tenno/Pistol/Pistol" }],
@ -197,11 +202,6 @@ export const addStartingGear = async (
combineInventoryChanges(inventoryChanges, inventoryDelta);
}
if (inventory.ReceivedStartingGear) {
logger.warn(`account already had starting gear but asked for it again?!`);
}
inventory.ReceivedStartingGear = true;
return inventoryChanges;
};