mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-06 02:45:31 +00:00
Avoid rotating by zero in CharacterController
This commit is contained in:
parent
7201cf5fe2
commit
1eb3384043
1 changed files with 6 additions and 2 deletions
|
@ -1872,10 +1872,14 @@ void CharacterController::update(float duration)
|
|||
{
|
||||
if(mHitState != CharState_KnockDown && mHitState != CharState_KnockOut)
|
||||
{
|
||||
world->rotateObject(mPtr, rot.x(), rot.y(), rot.z(), true);
|
||||
if (rot != osg::Vec3f())
|
||||
world->rotateObject(mPtr, rot.x(), rot.y(), rot.z(), true);
|
||||
}
|
||||
else //avoid z-rotating for knockdown
|
||||
world->rotateObject(mPtr, rot.x(), rot.y(), 0.0f, true);
|
||||
{
|
||||
if (rot.x() != 0 && rot.y() != 0)
|
||||
world->rotateObject(mPtr, rot.x(), rot.y(), 0.0f, true);
|
||||
}
|
||||
|
||||
if (!mMovementAnimationControlled)
|
||||
world->queueMovement(mPtr, vec);
|
||||
|
|
Loading…
Reference in a new issue