Account for creatures not having a model in more places

This commit is contained in:
Evil Eye 2025-04-05 10:19:50 +02:00
parent 3901084cc2
commit 15f4368fe6
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,6 +259,7 @@ namespace MWRender
void CreatureWeaponAnimation::addControllers()
{
Animation::addControllers();
if (mObjectRoot)
WeaponAnimation::addControllers(mNodeMap, mActiveControllers, mObjectRoot.get());
}