mirror of
https://github.com/OpenMW/openmw.git
synced 2025-06-01 21:41:34 +00:00
Check for disabled levitation (fixes #3766)
This commit is contained in:
parent
50f3794d12
commit
04eb4ea6b6
1 changed files with 15 additions and 0 deletions
|
@ -596,6 +596,21 @@ namespace MWMechanics
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// purge levitate effect if levitation is disabled
|
||||||
|
// check only modifier, because base value can be setted from SetFlying console command.
|
||||||
|
if (MWBase::Environment::get().getWorld()->isLevitationEnabled() == false && effects.get(ESM::MagicEffect::Levitate).getModifier() > 0)
|
||||||
|
{
|
||||||
|
creatureStats.getSpells().purgeEffect(ESM::MagicEffect::Levitate);
|
||||||
|
creatureStats.getActiveSpells().purgeEffect(ESM::MagicEffect::Levitate);
|
||||||
|
if (ptr.getClass().hasInventoryStore(ptr))
|
||||||
|
ptr.getClass().getInventoryStore(ptr).purgeEffect(ESM::MagicEffect::Levitate);
|
||||||
|
|
||||||
|
if (ptr == getPlayer())
|
||||||
|
{
|
||||||
|
MWBase::Environment::get().getWindowManager()->messageBox ("#{sLevitateDisabled}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// attributes
|
// attributes
|
||||||
for(int i = 0;i < ESM::Attribute::Length;++i)
|
for(int i = 0;i < ESM::Attribute::Length;++i)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue