mirror of
https://github.com/OpenMW/openmw.git
synced 2026-02-01 03:48:27 +00:00
Merge branch 'timingismagic' into 'master'
Address magic effect timing issues Closes #8929 See merge request OpenMW/openmw!5128
This commit is contained in:
commit
6b3a3418c2
2 changed files with 751 additions and 727 deletions
|
|
@ -381,6 +381,11 @@ namespace MWMechanics
|
|||
std::optional<ActiveSpellParams> reflected;
|
||||
for (auto it = spellIt->mEffects.begin(); it != spellIt->mEffects.end();)
|
||||
{
|
||||
if (it->mFlags & ESM::ActiveEffect::Flag_Remove && it->mTimeLeft <= 0.f)
|
||||
{
|
||||
++it;
|
||||
continue;
|
||||
}
|
||||
auto result = applyMagicEffect(ptr, caster, *spellIt, *it, duration, context.mPlayNonLooping);
|
||||
if (result.mType == MagicApplicationResult::Type::REFLECTED)
|
||||
{
|
||||
|
|
@ -490,10 +495,8 @@ namespace MWMechanics
|
|||
{
|
||||
if (merge(found->mEffects, spell.mEffects))
|
||||
return;
|
||||
auto params = *found;
|
||||
mSpells.erase(found);
|
||||
for (const auto& effect : params.mEffects)
|
||||
onMagicEffectRemoved(ptr, params, effect);
|
||||
for (auto& effect : found->mEffects)
|
||||
effect.mTimeLeft = 0.f;
|
||||
}
|
||||
}
|
||||
initParams(ptr, spell, context);
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue