From b666f1d551f7ae2c980f4547c2a9f9ef87a4c631 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Fri, 26 Apr 2013 01:30:36 -0700 Subject: [PATCH] Work around a problem with MWRender::Player::renderPlayer NpcAnimation::setViewMode makes a call to the character controller, in the mechanics manager, to forcefully update the character's state. This in turn makes a call to the player's old NpcAniamtion object that was just deleted. The mechanics manager will eventually remove and reinsert the player, so the old character controller will be removed and a new one will get the right Animation object again, but not in time for the setViewMode call. There's many factors that all contribute to this run-around, which needs discussion on how to best fix. --- apps/openmw/mwrender/player.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/openmw/mwrender/player.cpp b/apps/openmw/mwrender/player.cpp index 439264f3af..fb0602bdae 100644 --- a/apps/openmw/mwrender/player.cpp +++ b/apps/openmw/mwrender/player.cpp @@ -307,11 +307,11 @@ namespace MWRender void Player::setAnimation(NpcAnimation *anim) { + anim->setViewMode((mVanity.enabled || mPreviewMode || !mFirstPersonView) ? + NpcAnimation::VM_Normal : NpcAnimation::VM_FirstPerson); + delete mAnimation; mAnimation = anim; - - mAnimation->setViewMode((mVanity.enabled || mPreviewMode || !mFirstPersonView) ? - NpcAnimation::VM_Normal : NpcAnimation::VM_FirstPerson); } void Player::setHeight(float height)