mirror of
https://github.com/OpenMW/openmw.git
synced 2025-06-19 13:41:32 +00:00
Apply instant FX in AddSpell immediately (bug #5055)
This commit is contained in:
parent
56c9c72bc7
commit
82ac99ec56
2 changed files with 12 additions and 0 deletions
|
@ -105,6 +105,7 @@
|
||||||
Bug #5038: Enchanting success chance calculations are blatantly wrong
|
Bug #5038: Enchanting success chance calculations are blatantly wrong
|
||||||
Bug #5047: # in cell names sets color
|
Bug #5047: # in cell names sets color
|
||||||
Bug #5050: Invalid spell effects are not handled gracefully
|
Bug #5050: Invalid spell effects are not handled gracefully
|
||||||
|
Bug #5055: Mark, Recall, Intervention magic effect abilities have no effect when added and removed in the same frame
|
||||||
Bug #5056: Calling Cast function on player doesn't equip the spell but casts it
|
Bug #5056: Calling Cast function on player doesn't equip the spell but casts it
|
||||||
Bug #5060: Magic effect visuals stop when death animation begins instead of when it ends
|
Bug #5060: Magic effect visuals stop when death animation begins instead of when it ends
|
||||||
Bug #5063: Shape named "Tri Shadow" in creature mesh is visible if it isn't hidden
|
Bug #5063: Shape named "Tri Shadow" in creature mesh is visible if it isn't hidden
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
#include "../mwmechanics/creaturestats.hpp"
|
#include "../mwmechanics/creaturestats.hpp"
|
||||||
#include "../mwmechanics/npcstats.hpp"
|
#include "../mwmechanics/npcstats.hpp"
|
||||||
#include "../mwmechanics/actorutil.hpp"
|
#include "../mwmechanics/actorutil.hpp"
|
||||||
|
#include "../mwmechanics/spellcasting.hpp"
|
||||||
|
|
||||||
#include "ref.hpp"
|
#include "ref.hpp"
|
||||||
|
|
||||||
|
@ -464,6 +465,16 @@ namespace MWScript
|
||||||
{
|
{
|
||||||
// Apply looping particles immediately for constant effects
|
// Apply looping particles immediately for constant effects
|
||||||
MWBase::Environment::get().getWorld()->applyLoopingParticles(ptr);
|
MWBase::Environment::get().getWorld()->applyLoopingParticles(ptr);
|
||||||
|
|
||||||
|
// The spell may have an instant effect which must be handled immediately.
|
||||||
|
for (const auto& effect : creatureStats.getSpells().getMagicEffects())
|
||||||
|
{
|
||||||
|
if (effect.second.getMagnitude() <= 0)
|
||||||
|
continue;
|
||||||
|
MWMechanics::CastSpell cast(ptr, ptr);
|
||||||
|
if (cast.applyInstantEffect(ptr, ptr, effect.first, effect.second.getMagnitude()))
|
||||||
|
creatureStats.getSpells().purgeEffect(effect.first.mId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue