mirror of
https://github.com/OpenMW/openmw.git
synced 2025-06-02 19:11:31 +00:00
Make RemoveSpellEffects affect permanent spells (bug #3920)
Also make it remove the effects but not the spells themselves
This commit is contained in:
parent
c280a71b33
commit
6c47f95677
5 changed files with 23 additions and 2 deletions
|
@ -31,6 +31,7 @@
|
||||||
Bug #3876: Landscape texture painting is misaligned
|
Bug #3876: Landscape texture painting is misaligned
|
||||||
Bug #3897: Have Goodbye give all choices the effects of Goodbye
|
Bug #3897: Have Goodbye give all choices the effects of Goodbye
|
||||||
Bug #3911: [macOS] Typing in the "Content List name" dialog box produces double characters
|
Bug #3911: [macOS] Typing in the "Content List name" dialog box produces double characters
|
||||||
|
Bug #3920: RemoveSpellEffects doesn't remove constant effects
|
||||||
Bug #3948: AiCombat moving target aiming uses incorrect speed for magic projectiles
|
Bug #3948: AiCombat moving target aiming uses incorrect speed for magic projectiles
|
||||||
Bug #3950: FLATTEN_STATIC_TRANSFORMS optimization breaks animated collision shapes
|
Bug #3950: FLATTEN_STATIC_TRANSFORMS optimization breaks animated collision shapes
|
||||||
Bug #3993: Terrain texture blending map is not upscaled
|
Bug #3993: Terrain texture blending map is not upscaled
|
||||||
|
|
|
@ -197,8 +197,12 @@ namespace MWMechanics
|
||||||
|
|
||||||
void ActiveSpells::removeEffects(const std::string &id)
|
void ActiveSpells::removeEffects(const std::string &id)
|
||||||
{
|
{
|
||||||
mSpells.erase(Misc::StringUtils::lowerCase(id));
|
TContainer::iterator spell(mSpells.find(id));
|
||||||
mSpellsChanged = true;
|
if (spell != end());
|
||||||
|
{
|
||||||
|
spell->second.mEffects.clear();
|
||||||
|
mSpellsChanged = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ActiveSpells::visitEffectSources(EffectSourceVisitor &visitor) const
|
void ActiveSpells::visitEffectSources(EffectSourceVisitor &visitor) const
|
||||||
|
|
|
@ -279,6 +279,19 @@ namespace MWMechanics
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Spells::removeEffects(const std::string &id)
|
||||||
|
{
|
||||||
|
if (isSpellActive(id))
|
||||||
|
{
|
||||||
|
TContainer::iterator spellIt = mSpells.find(getSpell(id));
|
||||||
|
for (long unsigned int i = 0; i != spellIt->first->mEffects.mList.size(); i++)
|
||||||
|
{
|
||||||
|
spellIt->second.mPurgedEffects.insert(i);
|
||||||
|
mSpellsChanged = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Spells::visitEffectSources(EffectSourceVisitor &visitor) const
|
void Spells::visitEffectSources(EffectSourceVisitor &visitor) const
|
||||||
{
|
{
|
||||||
if (mSpellsChanged) {
|
if (mSpellsChanged) {
|
||||||
|
|
|
@ -124,6 +124,8 @@ namespace MWMechanics
|
||||||
|
|
||||||
bool hasBlightDisease() const;
|
bool hasBlightDisease() const;
|
||||||
|
|
||||||
|
void removeEffects(const std::string& id);
|
||||||
|
|
||||||
void visitEffectSources (MWMechanics::EffectSourceVisitor& visitor) const;
|
void visitEffectSources (MWMechanics::EffectSourceVisitor& visitor) const;
|
||||||
|
|
||||||
void readState (const ESM::SpellState& state);
|
void readState (const ESM::SpellState& state);
|
||||||
|
|
|
@ -501,6 +501,7 @@ namespace MWScript
|
||||||
runtime.pop();
|
runtime.pop();
|
||||||
|
|
||||||
ptr.getClass().getCreatureStats (ptr).getActiveSpells().removeEffects(spellid);
|
ptr.getClass().getCreatureStats (ptr).getActiveSpells().removeEffects(spellid);
|
||||||
|
ptr.getClass().getCreatureStats (ptr).getSpells().removeEffects(spellid);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue