Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid making expensive visitEffectSources calls if no spell absorption effect is active #1990

Merged
merged 1 commit into from
Oct 27, 2018

Conversation

Capostrophic
Copy link
Collaborator

For spell absorption effect to be multiplicative, the engine needs to iterate through each and every effect source to make sure all of them are accounted for. But it doesn't need to do this if there isn't any absorption effect active.

@akortunov
Copy link
Collaborator

You can just modify the "if" statement, in this case amount of changes will be much smaller.

@Capostrophic
Copy link
Collaborator Author

You can just modify the "if" statement, in this case amount of changes will be much smaller.

I can't initialize creature stats reference before I know for sure that the target is in fact an actor and
a call like

target.getClass().getCreatureStats(target).getMagicEffects().get(ESM::MagicEffect::SpellAbsorption).getMagnitude()

from within a condition doesn't look very nice.

@psi29a psi29a merged commit 9f4892c into OpenMW:master Oct 27, 2018
@Capostrophic Capostrophic deleted the absorption branch October 27, 2018 15:46
ananace pushed a commit to ananace/openmw that referenced this pull request Nov 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants