A tiny speed improvement in ApplyFoodExhaustion()
This commit is contained in:
parent
b4b3b5ce64
commit
15767badac
@ -1849,16 +1849,16 @@ void cPlayer::ApplyFoodExhaustionFromMovement()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Calculate the distance travelled, update the last pos:
|
|
||||||
Vector3d Movement(GetPosition() - m_LastPos);
|
|
||||||
Movement.y = 0; // Only take XZ movement into account
|
|
||||||
|
|
||||||
// If riding anything, apply no food exhaustion
|
// If riding anything, apply no food exhaustion
|
||||||
if (m_AttachedTo != NULL)
|
if (m_AttachedTo != NULL)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Calculate the distance travelled, update the last pos:
|
||||||
|
Vector3d Movement(GetPosition() - m_LastPos);
|
||||||
|
Movement.y = 0; // Only take XZ movement into account
|
||||||
|
|
||||||
// Apply the exhaustion based on distance travelled:
|
// Apply the exhaustion based on distance travelled:
|
||||||
double BaseExhaustion = Movement.Length();
|
double BaseExhaustion = Movement.Length();
|
||||||
if (IsSprinting())
|
if (IsSprinting())
|
||||||
|
Loading…
Reference in New Issue
Block a user