Fix uninitialized flags for custom-made spells

deque
scrawl 10 years ago
parent d99e416208
commit 7e10818bdf

@ -422,12 +422,12 @@ namespace MWGui
y *= 1.5;
}
mSpell.mData.mCost = int(y);
ESM::EffectList effectList;
effectList.mList = mEffects;
mSpell.mEffects = effectList;
mSpell.mData.mCost = int(y);
mSpell.mData.mType = ESM::Spell::ST_Spell;
mSpell.mData.mFlags = 0;
mMagickaCost->setCaption(boost::lexical_cast<std::string>(int(y)));

@ -53,6 +53,9 @@ namespace MWMechanics
MWWorld::ContainerStore& store = player.getClass().getContainerStore(player);
ESM::Enchantment enchantment;
enchantment.mData.mCharge = getGemCharge();
enchantment.mData.mAutocalc = 0;
enchantment.mData.mType = mCastStyle;
enchantment.mData.mCost = getEnchantPoints();
store.remove(mSoulGemPtr, 1, player);
@ -72,8 +75,6 @@ namespace MWMechanics
{
enchantment.mData.mCharge=0;
}
enchantment.mData.mType = mCastStyle;
enchantment.mData.mCost = getEnchantPoints();
enchantment.mEffects = mEffectList;
// Apply the enchantment

Loading…
Cancel
Save