forked from mirror/openmw-tes3mp
[Client] Prevent framerate drops caused by invalid rotation values
This commit is contained in:
parent
41de1876a3
commit
cf41956cad
2 changed files with 16 additions and 7 deletions
|
@ -104,9 +104,14 @@ void DedicatedActor::setMovementSettings()
|
||||||
move->mPosition[0] = direction.pos[0];
|
move->mPosition[0] = direction.pos[0];
|
||||||
move->mPosition[1] = direction.pos[1];
|
move->mPosition[1] = direction.pos[1];
|
||||||
move->mPosition[2] = direction.pos[2];
|
move->mPosition[2] = direction.pos[2];
|
||||||
move->mRotation[0] = direction.rot[0];
|
|
||||||
move->mRotation[1] = direction.rot[1];
|
// Make sure the values are valid, or we'll get an infinite error loop
|
||||||
move->mRotation[2] = direction.rot[2];
|
if (!isnan(direction.rot[0]) && !isnan(direction.rot[1]) && !isnan(direction.rot[2]))
|
||||||
|
{
|
||||||
|
move->mRotation[0] = direction.rot[0];
|
||||||
|
move->mRotation[1] = direction.rot[1];
|
||||||
|
move->mRotation[2] = direction.rot[2];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DedicatedActor::setPosition()
|
void DedicatedActor::setPosition()
|
||||||
|
|
|
@ -123,10 +123,14 @@ void DedicatedPlayer::move(float dt)
|
||||||
move->mPosition[0] = direction.pos[0];
|
move->mPosition[0] = direction.pos[0];
|
||||||
move->mPosition[1] = direction.pos[1];
|
move->mPosition[1] = direction.pos[1];
|
||||||
move->mPosition[2] = direction.pos[2];
|
move->mPosition[2] = direction.pos[2];
|
||||||
move->mRotation[0] = direction.rot[0];
|
|
||||||
move->mRotation[1] = direction.rot[1];
|
// Make sure the values are valid, or we'll get an infinite error loop
|
||||||
move->mRotation[2] = direction.rot[2];
|
if (!isnan(direction.rot[0]) && !isnan(direction.rot[1]) && !isnan(direction.rot[2]))
|
||||||
|
{
|
||||||
|
move->mRotation[0] = direction.rot[0];
|
||||||
|
move->mRotation[1] = direction.rot[1];
|
||||||
|
move->mRotation[2] = direction.rot[2];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DedicatedPlayer::setAnimFlags()
|
void DedicatedPlayer::setAnimFlags()
|
||||||
|
|
Loading…
Reference in a new issue