mirror of
https://github.com/OpenMW/openmw.git
synced 2025-03-03 21:09:41 +00:00
Merge branch 'actionshaveeffects' into 'master'
Turn ActorActiveEffects:remove into a delayed action Closes #8317, #8350, and #8366 See merge request OpenMW/openmw!4553
This commit is contained in:
commit
a6676fd6f3
2 changed files with 9 additions and 7 deletions
|
@ -82,7 +82,7 @@ message(STATUS "Configuring OpenMW...")
|
||||||
set(OPENMW_VERSION_MAJOR 0)
|
set(OPENMW_VERSION_MAJOR 0)
|
||||||
set(OPENMW_VERSION_MINOR 49)
|
set(OPENMW_VERSION_MINOR 49)
|
||||||
set(OPENMW_VERSION_RELEASE 0)
|
set(OPENMW_VERSION_RELEASE 0)
|
||||||
set(OPENMW_LUA_API_REVISION 70)
|
set(OPENMW_LUA_API_REVISION 71)
|
||||||
set(OPENMW_POSTPROCESSING_API_REVISION 2)
|
set(OPENMW_POSTPROCESSING_API_REVISION 2)
|
||||||
|
|
||||||
set(OPENMW_VERSION_COMMITHASH "")
|
set(OPENMW_VERSION_COMMITHASH "")
|
||||||
|
|
|
@ -1061,7 +1061,7 @@ namespace MWLua
|
||||||
};
|
};
|
||||||
|
|
||||||
// types.Actor.activeEffects(o):removeEffect(id, ?arg)
|
// types.Actor.activeEffects(o):removeEffect(id, ?arg)
|
||||||
activeEffectsT["remove"] = [getEffectKey](const ActorActiveEffects& effects, std::string_view idStr,
|
activeEffectsT["remove"] = [getEffectKey, context](const ActorActiveEffects& effects, std::string_view idStr,
|
||||||
sol::optional<std::string_view> argStr) {
|
sol::optional<std::string_view> argStr) {
|
||||||
if (!effects.isActor())
|
if (!effects.isActor())
|
||||||
return;
|
return;
|
||||||
|
@ -1071,12 +1071,14 @@ namespace MWLua
|
||||||
|
|
||||||
MWMechanics::EffectKey key = getEffectKey(idStr, argStr);
|
MWMechanics::EffectKey key = getEffectKey(idStr, argStr);
|
||||||
|
|
||||||
// Note that, although this is member method of ActorActiveEffects and we are removing an effect (not a
|
context.mLuaManager->addAction([key, effects]() {
|
||||||
// spell), we still need to use the active spells store to purge this effect from active spells.
|
// Note that, although this is member method of ActorActiveEffects and we are removing an effect (not a
|
||||||
const auto& ptr = effects.mActor.ptr();
|
// spell), we still need to use the active spells store to purge this effect from active spells.
|
||||||
|
const auto& ptr = effects.mActor.ptr();
|
||||||
|
|
||||||
auto& activeSpells = ptr.getClass().getCreatureStats(ptr).getActiveSpells();
|
auto& activeSpells = ptr.getClass().getCreatureStats(ptr).getActiveSpells();
|
||||||
activeSpells.purgeEffect(ptr, key.mId, key.mArg);
|
activeSpells.purgeEffect(ptr, key.mId, key.mArg);
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
// types.Actor.activeEffects(o):set(value, id, ?arg)
|
// types.Actor.activeEffects(o):set(value, id, ?arg)
|
||||||
|
|
Loading…
Reference in a new issue