mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-03 18:15:35 +00:00
Support effects with attribute/skill argument in OpGetEffect
This commit is contained in:
parent
1ec338f19d
commit
5f349b9a6e
1 changed files with 11 additions and 3 deletions
|
@ -422,9 +422,17 @@ namespace MWScript
|
||||||
if(key < 0 || key > 32767 || *end != '\0')
|
if(key < 0 || key > 32767 || *end != '\0')
|
||||||
key = ESM::MagicEffect::effectStringToId(effect);
|
key = ESM::MagicEffect::effectStringToId(effect);
|
||||||
|
|
||||||
runtime.push(ptr.getClass().getCreatureStats(ptr).getMagicEffects().get(
|
const MWMechanics::MagicEffects& effects = ptr.getClass().getCreatureStats(ptr).getMagicEffects();
|
||||||
MWMechanics::EffectKey(key)).getMagnitude() > 0);
|
for (MWMechanics::MagicEffects::Collection::const_iterator it = effects.begin(); it != effects.end(); ++it)
|
||||||
}
|
{
|
||||||
|
if (it->first.mId == key)
|
||||||
|
{
|
||||||
|
runtime.push(1);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
runtime.push(0);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template<class R>
|
template<class R>
|
||||||
|
|
Loading…
Reference in a new issue