mirror of
https://github.com/OpenMW/openmw.git
synced 2025-11-08 20:16:43 +00:00
Merge branch 'smexypants' into 'master'
Make ExtraSpell undress less See merge request OpenMW/openmw!4752
This commit is contained in:
commit
3135e2e479
1 changed files with 26 additions and 3 deletions
|
|
@ -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:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue