From 7e10818bdfa5c5f7e0bce710ca771538b42869c3 Mon Sep 17 00:00:00 2001 From: scrawl Date: Thu, 2 Oct 2014 00:32:22 +0200 Subject: [PATCH] Fix uninitialized flags for custom-made spells --- apps/openmw/mwgui/spellcreationdialog.cpp | 4 ++-- apps/openmw/mwmechanics/enchanting.cpp | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/openmw/mwgui/spellcreationdialog.cpp b/apps/openmw/mwgui/spellcreationdialog.cpp index 1116d6543..e2fac9d6d 100644 --- a/apps/openmw/mwgui/spellcreationdialog.cpp +++ b/apps/openmw/mwgui/spellcreationdialog.cpp @@ -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(int(y))); diff --git a/apps/openmw/mwmechanics/enchanting.cpp b/apps/openmw/mwmechanics/enchanting.cpp index 63ffbc7e8..c134942b8 100644 --- a/apps/openmw/mwmechanics/enchanting.cpp +++ b/apps/openmw/mwmechanics/enchanting.cpp @@ -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