mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-21 11:53:53 +00:00
Preserve the original caster if classic reflected absorb spells behaviour is on
This commit is contained in:
parent
ef60f2d191
commit
55b066d2bd
1 changed files with 9 additions and 1 deletions
|
@ -9,6 +9,8 @@
|
||||||
|
|
||||||
#include <components/esm/loadmgef.hpp>
|
#include <components/esm/loadmgef.hpp>
|
||||||
|
|
||||||
|
#include <components/settings/settings.hpp>
|
||||||
|
|
||||||
#include "creaturestats.hpp"
|
#include "creaturestats.hpp"
|
||||||
#include "spellcasting.hpp"
|
#include "spellcasting.hpp"
|
||||||
#include "spelleffects.hpp"
|
#include "spelleffects.hpp"
|
||||||
|
@ -236,7 +238,13 @@ namespace MWMechanics
|
||||||
if(result == MagicApplicationResult::REFLECTED)
|
if(result == MagicApplicationResult::REFLECTED)
|
||||||
{
|
{
|
||||||
if(!reflected)
|
if(!reflected)
|
||||||
reflected = {*spellIt, ptr};
|
{
|
||||||
|
static const bool keepOriginalCaster = Settings::Manager::getBool("classic reflected absorb spells behavior", "Game");
|
||||||
|
if(keepOriginalCaster)
|
||||||
|
reflected = {*spellIt, caster};
|
||||||
|
else
|
||||||
|
reflected = {*spellIt, ptr};
|
||||||
|
}
|
||||||
auto& reflectedEffect = reflected->mEffects.emplace_back(*it);
|
auto& reflectedEffect = reflected->mEffects.emplace_back(*it);
|
||||||
reflectedEffect.mFlags = ESM::ActiveEffect::Flag_Ignore_Reflect | ESM::ActiveEffect::Flag_Ignore_SpellAbsorption;
|
reflectedEffect.mFlags = ESM::ActiveEffect::Flag_Ignore_Reflect | ESM::ActiveEffect::Flag_Ignore_SpellAbsorption;
|
||||||
it = spellIt->mEffects.erase(it);
|
it = spellIt->mEffects.erase(it);
|
||||||
|
|
Loading…
Reference in a new issue