1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-16 18:59:57 +00:00

Merge branch 'autoequipcrash' into 'master'

Avoid crashes upon Weapon::canBeEquipped attack check for the inventory doll (#7744)

Closes #7744

See merge request OpenMW/openmw!3697
This commit is contained in:
Evil Eye 2023-12-29 14:30:49 +00:00
commit 3f6c3e24f4

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);