Skip to content

Commit 2ed14de

Browse files
committed
Merge branch 'objectrootless' into 'master'
Account for creatures not having a model in more places Closes #8439 See merge request OpenMW/openmw!4618
2 parents 3901084 + 15f4368 commit 2ed14de

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@
229229
Bug #8299: Crash while smoothing landscape
230230
Bug #8364: Crash when clicking scrollbar without handle (divide by zero)
231231
Bug #8378: Korean bitmap fonts are unusable
232+
Bug #8439: Creatures without models can crash the game
232233
Feature #1415: Infinite fall failsafe
233234
Feature #2566: Handle NAM9 records for manual cell references
234235
Feature #3501: OpenMW-CS: Instance Editing - Shortcuts for axial locking

apps/openmw/mwrender/actoranimation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ namespace MWRender
161161

162162
bool ActorAnimation::updateCarriedLeftVisible(const int weaptype) const
163163
{
164-
if (Settings::game().mShieldSheathing)
164+
if (Settings::game().mShieldSheathing && mObjectRoot)
165165
{
166166
const MWWorld::Class& cls = mPtr.getClass();
167167
MWMechanics::CreatureStats& stats = cls.getCreatureStats(mPtr);

apps/openmw/mwrender/animation.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1695,7 +1695,7 @@ namespace MWRender
16951695
mGlowUpdater->setColor(color);
16961696
mGlowUpdater->setDuration(glowDuration);
16971697
}
1698-
else
1698+
else if (mObjectRoot)
16991699
mGlowUpdater = SceneUtil::addEnchantedGlow(mObjectRoot, mResourceSystem, color, glowDuration);
17001700
}
17011701
}
@@ -1869,7 +1869,7 @@ namespace MWRender
18691869

18701870
void Animation::setAlpha(float alpha)
18711871
{
1872-
if (alpha == mAlpha)
1872+
if (alpha == mAlpha || !mObjectRoot)
18731873
return;
18741874
mAlpha = alpha;
18751875

apps/openmw/mwrender/creatureanimation.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,8 @@ namespace MWRender
259259
void CreatureWeaponAnimation::addControllers()
260260
{
261261
Animation::addControllers();
262-
WeaponAnimation::addControllers(mNodeMap, mActiveControllers, mObjectRoot.get());
262+
if (mObjectRoot)
263+
WeaponAnimation::addControllers(mNodeMap, mActiveControllers, mObjectRoot.get());
263264
}
264265

265266
osg::Vec3f CreatureWeaponAnimation::runAnimation(float duration)

0 commit comments

Comments
 (0)