Skip to content

Commit

Permalink
Don't reset idle time when there is no camera movement (Fixes #3902)
Browse files Browse the repository at this point in the history
  • Loading branch information
scrawl committed Jun 26, 2017
1 parent 7704dcf commit ec458ef
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions apps/openmw/mwinput/inputmanagerimp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -417,18 +417,21 @@ namespace MWInput
{
float xAxis = mInputBinder->getChannel(A_LookLeftRight)->getValue()*2.0f-1.0f;
float yAxis = mInputBinder->getChannel(A_LookUpDown)->getValue()*2.0f-1.0f;
resetIdleTime();
if (xAxis != 0 || yAxis != 0)
{
resetIdleTime();

float rot[3];
rot[0] = yAxis * (dt * 100.0f) * 10.0f * mCameraSensitivity * (1.0f/256.f) * (mInvertY ? -1 : 1) * mCameraYMultiplier;
rot[1] = 0.0f;
rot[2] = xAxis * (dt * 100.0f) * 10.0f * mCameraSensitivity * (1.0f/256.f);
float rot[3];
rot[0] = yAxis * (dt * 100.0f) * 10.0f * mCameraSensitivity * (1.0f/256.f) * (mInvertY ? -1 : 1) * mCameraYMultiplier;
rot[1] = 0.0f;
rot[2] = xAxis * (dt * 100.0f) * 10.0f * mCameraSensitivity * (1.0f/256.f);

// Only actually turn player when we're not in vanity mode
if(!MWBase::Environment::get().getWorld()->vanityRotateCamera(rot))
{
mPlayer->yaw(rot[2]);
mPlayer->pitch(rot[0]);
// Only actually turn player when we're not in vanity mode
if(!MWBase::Environment::get().getWorld()->vanityRotateCamera(rot))
{
mPlayer->yaw(rot[2]);
mPlayer->pitch(rot[0]);
}
}
}

Expand Down

0 comments on commit ec458ef

Please sign in to comment.