1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-11-30 21:04:33 +00:00

Make ExtraSpell undress less

This commit is contained in:
Evil Eye 2025-07-06 12:10:49 +02:00
parent 9b8a383e8d
commit 3574cd552c

View file

@ -519,8 +519,31 @@ namespace MWMechanics
case ESM::MagicEffect::ExtraSpell: case ESM::MagicEffect::ExtraSpell:
if (target.getClass().hasInventoryStore(target)) if (target.getClass().hasInventoryStore(target))
{ {
auto& store = target.getClass().getInventoryStore(target); if (target != getPlayer())
store.unequipAll(); {
auto& store = target.getClass().getInventoryStore(target);
for (int slot = 0; slot < MWWorld::InventoryStore::Slots; ++slot)
{
// Unequip everything except weapons, torches, and pants
switch (slot)
{
case MWWorld::InventoryStore::Slot_Ammunition:
case MWWorld::InventoryStore::Slot_CarriedRight:
case MWWorld::InventoryStore::Slot_Pants:
continue;
case MWWorld::InventoryStore::Slot_CarriedLeft:
{
auto carried = store.getSlot(slot);
if (carried == store.end()
|| carried.getType() != MWWorld::ContainerStore::Type_Armor)
continue;
[[fallthrough]];
}
default:
store.unequipSlot(slot);
}
}
}
} }
else else
invalid = true; invalid = true;
@ -1083,7 +1106,7 @@ namespace MWMechanics
} }
break; break;
case ESM::MagicEffect::ExtraSpell: case ESM::MagicEffect::ExtraSpell:
if (magnitudes.getOrDefault(effect.mEffectId).getMagnitude() <= 0.f) if (magnitudes.getOrDefault(effect.mEffectId).getMagnitude() <= 0.f && target != getPlayer())
target.getClass().getInventoryStore(target).autoEquip(); target.getClass().getInventoryStore(target).autoEquip();
break; break;
case ESM::MagicEffect::TurnUndead: case ESM::MagicEffect::TurnUndead: