Prevent tapping into System.currentTimeMillis for each isFalling call.

This commit is contained in:
MobiusDevelopment
2019-11-03 07:38:53 +00:00
parent a48b50ffbb
commit 54fd9a24c8
18 changed files with 77 additions and 35 deletions

View File

@ -12710,7 +12710,7 @@ public class PlayerInstance extends Playable
return false;
}
if (System.currentTimeMillis() < _fallingTimestamp)
if ((_fallingTimestamp != 0) && (System.currentTimeMillis() < _fallingTimestamp))
{
return true;
}
@ -12718,12 +12718,14 @@ public class PlayerInstance extends Playable
final int deltaZ = getZ() - z;
if (deltaZ <= getBaseTemplate().getSafeFallHeight())
{
_fallingTimestamp = 0;
return false;
}
// If there is no geodata loaded for the place we are client Z correction might cause falling damage.
// If there is no geodata loaded for the place we are, client Z correction might cause falling damage.
if (!GeoEngine.getInstance().hasGeo(getX(), getY()))
{
_fallingTimestamp = 0;
return false;
}