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

@ -12703,7 +12703,7 @@ public class PlayerInstance extends Playable
return false;
}
if (System.currentTimeMillis() < _fallingTimestamp)
if ((_fallingTimestamp != 0) && (System.currentTimeMillis() < _fallingTimestamp))
{
return true;
}
@ -12711,12 +12711,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;
}

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;
}

View File

@ -12712,7 +12712,7 @@ public class PlayerInstance extends Playable
return false;
}
if (System.currentTimeMillis() < _fallingTimestamp)
if ((_fallingTimestamp != 0) && (System.currentTimeMillis() < _fallingTimestamp))
{
return true;
}
@ -12720,12 +12720,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;
}

View File

@ -12692,7 +12692,7 @@ public class PlayerInstance extends Playable
return false;
}
if (System.currentTimeMillis() < _fallingTimestamp)
if ((_fallingTimestamp != 0) && (System.currentTimeMillis() < _fallingTimestamp))
{
return true;
}
@ -12700,12 +12700,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;
}

View File

@ -12678,7 +12678,7 @@ public class PlayerInstance extends Playable
return false;
}
if (System.currentTimeMillis() < _fallingTimestamp)
if ((_fallingTimestamp != 0) && (System.currentTimeMillis() < _fallingTimestamp))
{
return true;
}
@ -12686,12 +12686,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;
}

View File

@ -12681,7 +12681,7 @@ public class PlayerInstance extends Playable
return false;
}
if (System.currentTimeMillis() < _fallingTimestamp)
if ((_fallingTimestamp != 0) && (System.currentTimeMillis() < _fallingTimestamp))
{
return true;
}
@ -12689,12 +12689,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;
}

View File

@ -12687,7 +12687,7 @@ public class PlayerInstance extends Playable
return false;
}
if (System.currentTimeMillis() < _fallingTimestamp)
if ((_fallingTimestamp != 0) && (System.currentTimeMillis() < _fallingTimestamp))
{
return true;
}
@ -12695,12 +12695,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;
}

View File

@ -12633,7 +12633,7 @@ public class PlayerInstance extends Playable
return false;
}
if (System.currentTimeMillis() < _fallingTimestamp)
if ((_fallingTimestamp != 0) && (System.currentTimeMillis() < _fallingTimestamp))
{
return true;
}
@ -12641,12 +12641,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;
}

View File

@ -17136,7 +17136,7 @@ public class PlayerInstance extends Playable
return false;
}
if (System.currentTimeMillis() < _fallingTimestamp)
if ((_fallingTimestamp != 0) && (System.currentTimeMillis() < _fallingTimestamp))
{
return true;
}
@ -17144,6 +17144,14 @@ public class PlayerInstance extends Playable
final int deltaZ = getZ() - z;
if (deltaZ <= getBaseTemplate().getFallHeight())
{
_fallingTimestamp = 0;
return false;
}
// 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;
}

View File

@ -13698,7 +13698,7 @@ public class PlayerInstance extends Playable
return false;
}
if (System.currentTimeMillis() < _fallingTimestamp)
if ((_fallingTimestamp != 0) && (System.currentTimeMillis() < _fallingTimestamp))
{
return true;
}
@ -13706,12 +13706,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;
}

View File

@ -13585,7 +13585,7 @@ public class PlayerInstance extends Playable
return false;
}
if (System.currentTimeMillis() < _fallingTimestamp)
if ((_fallingTimestamp != 0) && (System.currentTimeMillis() < _fallingTimestamp))
{
return true;
}
@ -13593,12 +13593,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;
}

View File

@ -12545,7 +12545,7 @@ public class PlayerInstance extends Playable
return false;
}
if (System.currentTimeMillis() < _fallingTimestamp)
if ((_fallingTimestamp != 0) && (System.currentTimeMillis() < _fallingTimestamp))
{
return true;
}
@ -12553,12 +12553,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;
}

View File

@ -12552,7 +12552,7 @@ public class PlayerInstance extends Playable
return false;
}
if (System.currentTimeMillis() < _fallingTimestamp)
if ((_fallingTimestamp != 0) && (System.currentTimeMillis() < _fallingTimestamp))
{
return true;
}
@ -12560,12 +12560,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;
}

View File

@ -12537,7 +12537,7 @@ public class PlayerInstance extends Playable
return false;
}
if (System.currentTimeMillis() < _fallingTimestamp)
if ((_fallingTimestamp != 0) && (System.currentTimeMillis() < _fallingTimestamp))
{
return true;
}
@ -12545,12 +12545,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;
}

View File

@ -12579,7 +12579,7 @@ public class PlayerInstance extends Playable
return false;
}
if (System.currentTimeMillis() < _fallingTimestamp)
if ((_fallingTimestamp != 0) && (System.currentTimeMillis() < _fallingTimestamp))
{
return true;
}
@ -12587,12 +12587,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;
}

View File

@ -12579,7 +12579,7 @@ public class PlayerInstance extends Playable
return false;
}
if (System.currentTimeMillis() < _fallingTimestamp)
if ((_fallingTimestamp != 0) && (System.currentTimeMillis() < _fallingTimestamp))
{
return true;
}
@ -12587,12 +12587,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;
}

View File

@ -12459,7 +12459,7 @@ public class PlayerInstance extends Playable
return false;
}
if (System.currentTimeMillis() < _fallingTimestamp)
if ((_fallingTimestamp != 0) && (System.currentTimeMillis() < _fallingTimestamp))
{
return true;
}
@ -12467,12 +12467,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;
}

View File

@ -12561,7 +12561,7 @@ public class PlayerInstance extends Playable
return false;
}
if (System.currentTimeMillis() < _fallingTimestamp)
if ((_fallingTimestamp != 0) && (System.currentTimeMillis() < _fallingTimestamp))
{
return true;
}
@ -12569,12 +12569,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;
}