forked from teamnwah/openmw-tes3coop
Fix crash during spell creation when an effect targeting a skill/attribute doesn't have one assigned yet (Fixes #1598)
This commit is contained in:
parent
5ec96c5394
commit
082b6125a9
1 changed files with 2 additions and 2 deletions
|
@ -419,11 +419,11 @@ namespace MWGui
|
|||
std::string effectIDStr = ESM::MagicEffect::effectIdToString(mEffectParams.mEffectID);
|
||||
std::string spellLine = MWBase::Environment::get().getWindowManager()->getGameSettingString(effectIDStr, "");
|
||||
|
||||
if (magicEffect->mData.mFlags & ESM::MagicEffect::TargetSkill)
|
||||
if (magicEffect->mData.mFlags & ESM::MagicEffect::TargetSkill && mEffectParams.mSkill != -1)
|
||||
{
|
||||
spellLine += " " + MWBase::Environment::get().getWindowManager()->getGameSettingString(ESM::Skill::sSkillNameIds[mEffectParams.mSkill], "");
|
||||
}
|
||||
if (magicEffect->mData.mFlags & ESM::MagicEffect::TargetAttribute)
|
||||
if (magicEffect->mData.mFlags & ESM::MagicEffect::TargetAttribute && mEffectParams.mAttribute != -1)
|
||||
{
|
||||
spellLine += " " + MWBase::Environment::get().getWindowManager()->getGameSettingString(ESM::Attribute::sGmstAttributeIds[mEffectParams.mAttribute], "");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue