summaryrefslogtreecommitdiffstats
path: root/src/Entities/Player.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/Entities/Player.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp
index f131a1829..7b3827f42 100644
--- a/src/Entities/Player.cpp
+++ b/src/Entities/Player.cpp
@@ -2141,6 +2141,8 @@ void cPlayer::ApplyFoodExhaustionFromMovement()
{
return;
}
+
+ // If we have just teleported, apply no exhaustion
if (m_bIsTeleporting)
{
m_bIsTeleporting = false;
@@ -2152,6 +2154,13 @@ void cPlayer::ApplyFoodExhaustionFromMovement()
{
return;
}
+
+ // Process exhaustion every two ticks as that is how frequently m_LastPos is updated
+ // Otherwise, we apply exhaustion for a 'movement' every tick, one of which is an already processed value
+ if (GetWorld()->GetWorldAge() % 2 != 0)
+ {
+ return;
+ }
// Calculate the distance travelled, update the last pos:
Vector3d Movement(GetPosition() - m_LastPos);