From f43c55b8e1596eabe4fac0958e3aa68055ca19e4 Mon Sep 17 00:00:00 2001 From: leia uwu Date: Fri, 4 Oct 2024 13:38:41 -0300 Subject: [PATCH] fix: dropItemMsg crash --- server/src/game/objects/player.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/server/src/game/objects/player.ts b/server/src/game/objects/player.ts index 30779e5e..c1640d73 100644 --- a/server/src/game/objects/player.ts +++ b/server/src/game/objects/player.ts @@ -3225,6 +3225,7 @@ export class Player extends BaseGameObject { dropItem(dropMsg: net.DropItemMsg): void { const itemDef = GameObjectDefs[dropMsg.item] as LootDef; + if (!itemDef) return; switch (itemDef.type) { case "ammo": { const inventoryCount = this.inventory[dropMsg.item];