From a0801ba27aa83a4689304d672a611e13ef887287 Mon Sep 17 00:00:00 2001 From: Ampitere Date: Sun, 12 May 2024 22:08:26 -0700 Subject: [PATCH] fix: non-equipment items can cause map crash --- src/map/lua/lua_baseentity.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/map/lua/lua_baseentity.cpp b/src/map/lua/lua_baseentity.cpp index 7b6d51583bf..26323da053e 100644 --- a/src/map/lua/lua_baseentity.cpp +++ b/src/map/lua/lua_baseentity.cpp @@ -4557,6 +4557,11 @@ bool CLuaBaseEntity::canEquipItem(uint16 itemID, sol::object const& chkLevel) return false; } + if (!PItem->isType(ITEM_EQUIPMENT)) + { + return false; + } + if (!(PItem->getJobs() & (1 << (PChar->GetMJob() - 1)))) { return false;