1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-12-02 16:34:31 +00:00

Merge branch 'defendingthelight' into 'master'

Only autoequip the shield in updateEquippedLight (#8404)

Closes #8404

See merge request OpenMW/openmw!4763
This commit is contained in:
psi29a 2025-07-17 14:23:57 +00:00
commit 3b42874797

View file

@ -1062,9 +1062,12 @@ namespace MWMechanics
{
if (heldIter != inventoryStore.end() && heldIter->getType() == ESM::Light::sRecordId)
{
// At day, unequip lights and auto equip shields or other suitable items
// (Note: autoEquip will ignore lights)
inventoryStore.autoEquip();
// At day, unequip lights and auto equip shields
auto shield = inventoryStore.getPreferredShield();
if (shield != inventoryStore.end())
inventoryStore.equip(MWWorld::InventoryStore::Slot_CarriedLeft, shield);
else
inventoryStore.unequipSlot(MWWorld::InventoryStore::Slot_CarriedLeft);
}
}
}