From a6c9c9d1f8b6b664229f4d68f72c2d2134a93b02 Mon Sep 17 00:00:00 2001 From: AnyOldName3 <krizdjali@gmail.com> Date: Mon, 2 May 2022 20:11:01 +0100 Subject: [PATCH 1/2] Don't return a random anonymous node from getArrowBone when the current weapon doesn't fire arrows. --- apps/openmw/mwrender/creatureanimation.cpp | 2 ++ apps/openmw/mwrender/npcanimation.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/apps/openmw/mwrender/creatureanimation.cpp b/apps/openmw/mwrender/creatureanimation.cpp index 78a524b74f..f3a92bff46 100644 --- a/apps/openmw/mwrender/creatureanimation.cpp +++ b/apps/openmw/mwrender/creatureanimation.cpp @@ -232,6 +232,8 @@ osg::Group *CreatureWeaponAnimation::getArrowBone() int type = weapon->get<ESM::Weapon>()->mBase->mData.mType; int ammoType = MWMechanics::getWeaponType(type)->mAmmoType; + if (ammoType == ESM::Weapon::None) + return nullptr; // Try to find and attachment bone in actor's skeleton, otherwise fall back to the ArrowBone in weapon's mesh osg::Group* bone = getBoneByName(MWMechanics::getWeaponType(ammoType)->mAttachBone); diff --git a/apps/openmw/mwrender/npcanimation.cpp b/apps/openmw/mwrender/npcanimation.cpp index 5b96fdb6ba..0d74b8d302 100644 --- a/apps/openmw/mwrender/npcanimation.cpp +++ b/apps/openmw/mwrender/npcanimation.cpp @@ -1034,6 +1034,8 @@ osg::Group* NpcAnimation::getArrowBone() int type = weapon->get<ESM::Weapon>()->mBase->mData.mType; int ammoType = MWMechanics::getWeaponType(type)->mAmmoType; + if (ammoType == ESM::Weapon::None) + return nullptr; // Try to find and attachment bone in actor's skeleton, otherwise fall back to the ArrowBone in weapon's mesh osg::Group* bone = getBoneByName(MWMechanics::getWeaponType(ammoType)->mAttachBone); From 2b9c7e77bda70515a4b63516a64d0c1dfeb8aa24 Mon Sep 17 00:00:00 2001 From: AnyOldName3 <krizdjali@gmail.com> Date: Tue, 3 May 2022 21:30:21 +0100 Subject: [PATCH 2/2] Appease the CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 29a199808d..8caa2fe0c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -116,6 +116,7 @@ Bug #6697: Shaders vertex lighting incorrectly clamped Bug #6711: Log time differs from real time Bug #6717: Broken script causes interpreter stack corruption + Bug #6718: Throwable weapons cause arrow enchantment effect to be applied to the whole body Feature #890: OpenMW-CS: Column filtering Feature #1465: "Reset" argument for AI functions Feature #2491: Ability to make OpenMW "portable"