mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-06 00:55:50 +00:00
Merge branch 'catch_me' into 'master'
Remove active effects from spells that no longer exist See merge request OpenMW/openmw!1273
This commit is contained in:
commit
3e2694dde9
@ -1,5 +1,7 @@
|
||||
#include "activespells.hpp"
|
||||
|
||||
#include <components/debug/debuglog.hpp>
|
||||
|
||||
#include <components/misc/rng.hpp>
|
||||
#include <components/misc/stringops.hpp>
|
||||
|
||||
@ -234,7 +236,17 @@ namespace MWMechanics
|
||||
|
||||
bool remove = false;
|
||||
if(spellIt->mType == ESM::ActiveSpells::Type_Ability || spellIt->mType == ESM::ActiveSpells::Type_Permanent)
|
||||
remove = !spells.hasSpell(spellIt->mId);
|
||||
{
|
||||
try
|
||||
{
|
||||
remove = !spells.hasSpell(spellIt->mId);
|
||||
}
|
||||
catch(const std::runtime_error& e)
|
||||
{
|
||||
remove = true;
|
||||
Log(Debug::Error) << "Removing active effect: " << e.what();
|
||||
}
|
||||
}
|
||||
else if(spellIt->mType == ESM::ActiveSpells::Type_Enchantment)
|
||||
{
|
||||
const auto& store = ptr.getClass().getInventoryStore(ptr);
|
||||
|
Loading…
Reference in New Issue
Block a user