Merge branch 'objectrootless' into 'master'

Account for creatures not having a model in more places

Closes #8439

See merge request OpenMW/openmw!4618
This commit is contained in:
psi29a 2025-04-06 16:01:50 +00:00
commit 2ed14de41f
4 changed files with 6 additions and 4 deletions

View file

@ -229,6 +229,7 @@
Bug #8299: Crash while smoothing landscape
Bug #8364: Crash when clicking scrollbar without handle (divide by zero)
Bug #8378: Korean bitmap fonts are unusable
Bug #8439: Creatures without models can crash the game
Feature #1415: Infinite fall failsafe
Feature #2566: Handle NAM9 records for manual cell references
Feature #3501: OpenMW-CS: Instance Editing - Shortcuts for axial locking

View file

@ -161,7 +161,7 @@ namespace MWRender
bool ActorAnimation::updateCarriedLeftVisible(const int weaptype) const
{
if (Settings::game().mShieldSheathing)
if (Settings::game().mShieldSheathing && mObjectRoot)
{
const MWWorld::Class& cls = mPtr.getClass();
MWMechanics::CreatureStats& stats = cls.getCreatureStats(mPtr);

View file

@ -1695,7 +1695,7 @@ namespace MWRender
mGlowUpdater->setColor(color);
mGlowUpdater->setDuration(glowDuration);
}
else
else if (mObjectRoot)
mGlowUpdater = SceneUtil::addEnchantedGlow(mObjectRoot, mResourceSystem, color, glowDuration);
}
}
@ -1869,7 +1869,7 @@ namespace MWRender
void Animation::setAlpha(float alpha)
{
if (alpha == mAlpha)
if (alpha == mAlpha || !mObjectRoot)
return;
mAlpha = alpha;

View file

@ -259,7 +259,8 @@ namespace MWRender
void CreatureWeaponAnimation::addControllers()
{
Animation::addControllers();
WeaponAnimation::addControllers(mNodeMap, mActiveControllers, mObjectRoot.get());
if (mObjectRoot)
WeaponAnimation::addControllers(mNodeMap, mActiveControllers, mObjectRoot.get());
}
osg::Vec3f CreatureWeaponAnimation::runAnimation(float duration)