1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-24 18:39:59 +00:00

Avoid crashes upon Weapon::canBeEquipped attack check for the inventory doll

This commit is contained in:
Alexei Kotov 2023-12-28 01:05:45 +03:00
parent 0b5823d5b7
commit 30cff6f6ee

View File

@ -276,8 +276,8 @@ namespace MWClass
return { 0, "#{sInventoryMessage1}" };
// Do not allow equip weapons from inventory during attack
if (MWBase::Environment::get().getMechanicsManager()->isAttackingOrSpell(npc)
&& MWBase::Environment::get().getWindowManager()->isGuiMode())
if (npc.isInCell() && MWBase::Environment::get().getWindowManager()->isGuiMode()
&& MWBase::Environment::get().getMechanicsManager()->isAttackingOrSpell(npc))
return { 0, "#{sCantEquipWeapWarning}" };
std::pair<std::vector<int>, bool> slots_ = getEquipmentSlots(ptr);