Fix uninitialized flags for custom-made spells

This commit is contained in:
scrawl 2014-10-02 00:32:22 +02:00
parent d99e416208
commit 7e10818bdf
2 changed files with 5 additions and 4 deletions

View file

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

View file

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