From 3f503c656130ef0266107eac4fcb00dc6bf12ae5 Mon Sep 17 00:00:00 2001 From: scrawl Date: Thu, 28 Aug 2014 16:31:06 +0200 Subject: [PATCH 1/3] Fix mSelectedEnchantItem cleanup not working for non-player actors --- apps/openmw/mwworld/inventorystore.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/openmw/mwworld/inventorystore.cpp b/apps/openmw/mwworld/inventorystore.cpp index 7ea4a0bf1d..efb6e1b65f 100644 --- a/apps/openmw/mwworld/inventorystore.cpp +++ b/apps/openmw/mwworld/inventorystore.cpp @@ -490,7 +490,7 @@ int MWWorld::InventoryStore::remove(const Ptr& item, int count, const Ptr& actor } if (item.getRefData().getCount() == 0 && mSelectedEnchantItem != end() - && *mSelectedEnchantItem == item && actor.getRefData().getHandle() == "player") + && *mSelectedEnchantItem == item) { mSelectedEnchantItem = end(); } @@ -521,11 +521,11 @@ MWWorld::ContainerStoreIterator MWWorld::InventoryStore::unequipSlot(int slot, c const std::string& script = it->getClass().getScript(*it); if (script != "") (*it).getRefData().getLocals().setVarByInt(script, "onpcequip", 0); + } - if ((mSelectedEnchantItem != end()) && (mSelectedEnchantItem == it)) - { - mSelectedEnchantItem = end(); - } + if ((mSelectedEnchantItem != end()) && (mSelectedEnchantItem == it)) + { + mSelectedEnchantItem = end(); } } From 927dcc7cdd736569adef204e52338301c4338bc8 Mon Sep 17 00:00:00 2001 From: scrawl Date: Thu, 28 Aug 2014 16:47:54 +0200 Subject: [PATCH 2/3] Another invalid iterator fix --- apps/openmw/mwmechanics/aicombat.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/openmw/mwmechanics/aicombat.cpp b/apps/openmw/mwmechanics/aicombat.cpp index 4d9e0571a5..d484071bf6 100644 --- a/apps/openmw/mwmechanics/aicombat.cpp +++ b/apps/openmw/mwmechanics/aicombat.cpp @@ -770,7 +770,7 @@ void getMinMaxAttackDuration(const MWWorld::Ptr& actor, float (*fMinMaxDurations // get weapon information: type and speed const ESM::Weapon *weapon = NULL; - MWMechanics::WeaponType weaptype; + MWMechanics::WeaponType weaptype = MWMechanics::WeapType_None; MWWorld::ContainerStoreIterator weaponSlot = MWMechanics::getActiveWeapon(actor.getClass().getCreatureStats(actor), actor.getClass().getInventoryStore(actor), &weaptype); From 84ad05b4faa08898d550c83408cdcd4efff34382 Mon Sep 17 00:00:00 2001 From: scrawl Date: Thu, 28 Aug 2014 17:02:11 +0200 Subject: [PATCH 3/3] Fix bone not found exception for golden saint spellcasting --- apps/openmw/mwmechanics/character.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/apps/openmw/mwmechanics/character.cpp b/apps/openmw/mwmechanics/character.cpp index aca8d988cf..de3714f756 100644 --- a/apps/openmw/mwmechanics/character.cpp +++ b/apps/openmw/mwmechanics/character.cpp @@ -870,10 +870,16 @@ bool CharacterController::updateWeaponState() mAnimation->addEffect("meshes\\" + castStatic->mModel, effect->mIndex); castStatic = MWBase::Environment::get().getWorld()->getStore().get().find ("VFX_Hands"); - //mAnimation->addEffect("meshes\\" + castStatic->mModel, -1, false, "Bip01 L Hand", effect->mParticle); - //mAnimation->addEffect("meshes\\" + castStatic->mModel, -1, false, "Bip01 R Hand", effect->mParticle); - mAnimation->addEffect("meshes\\" + castStatic->mModel, -1, false, "Left Hand", effect->mParticle); - mAnimation->addEffect("meshes\\" + castStatic->mModel, -1, false, "Right Hand", effect->mParticle); + if (mAnimation->getNode("Left Hand")) + { + mAnimation->addEffect("meshes\\" + castStatic->mModel, -1, false, "Left Hand", effect->mParticle); + mAnimation->addEffect("meshes\\" + castStatic->mModel, -1, false, "Right Hand", effect->mParticle); + } + else + { + mAnimation->addEffect("meshes\\" + castStatic->mModel, -1, false, "Bip01 L Hand", effect->mParticle); + mAnimation->addEffect("meshes\\" + castStatic->mModel, -1, false, "Bip01 R Hand", effect->mParticle); + } switch(effectentry.mRange) {