Skip to content

Commit

Permalink
Merge branch 'sheath_controllers' into 'master'
Browse files Browse the repository at this point in the history
Do not disable controllers for melee weapons sheathes

See merge request OpenMW/openmw!4406
  • Loading branch information
psi29a committed Oct 19, 2024
2 parents 001d390 + aab2f4a commit 088c20a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@
Bug #8171: Items with more than 100% health can be repaired
Bug #8172: Openmw-cs crashes when viewing `Dantooine, Sea`
Bug #8187: Intervention effects should use Chebyshev distance to determine the closest marker
Bug #8191: NiRollController does not work for sheath meshes
Feature #1415: Infinite fall failsafe
Feature #2566: Handle NAM9 records for manual cell references
Feature #3501: OpenMW-CS: Instance Editing - Shortcuts for axial locking
Expand Down
11 changes: 7 additions & 4 deletions apps/openmw/mwrender/actoranimation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,8 @@ namespace MWRender

// Since throwing weapons stack themselves, do not show such weapon itself
int type = weapon->get<ESM::Weapon>()->mBase->mData.mType;
if (MWMechanics::getWeaponType(type)->mWeaponClass == ESM::WeaponType::Thrown)
auto weaponClass = MWMechanics::getWeaponType(type)->mWeaponClass;
if (weaponClass == ESM::WeaponType::Thrown)
showHolsteredWeapons = false;

const VFS::Path::Normalized mesh = weapon->getClass().getCorrectedModel(*weapon);
Expand All @@ -356,15 +357,15 @@ namespace MWRender
const osg::Vec4f glowColor
= isEnchanted ? weapon->getClass().getEnchantmentColor(*weapon) : osg::Vec4f();
mScabbard = attachMesh(mesh, boneName, isEnchanted ? &glowColor : nullptr);
if (mScabbard)
if (mScabbard && weaponClass == ESM::WeaponType::Ranged)
resetControllers(mScabbard->getNode());
}

return;
}

mScabbard = attachMesh(scabbardName, boneName);
if (mScabbard)
if (mScabbard && weaponClass == ESM::WeaponType::Ranged)
resetControllers(mScabbard->getNode());

osg::Group* weaponNode = getBoneByName("Bip01 Weapon");
Expand All @@ -386,7 +387,9 @@ namespace MWRender
{
osg::ref_ptr<osg::Node> fallbackNode
= mResourceSystem->getSceneManager()->getInstance(mesh, weaponNode);
resetControllers(fallbackNode);

if (weaponClass == ESM::WeaponType::Ranged)
resetControllers(fallbackNode);
}

if (isEnchanted)
Expand Down

0 comments on commit 088c20a

Please sign in to comment.