Removed fall validation.

This commit is contained in:
MobiusDevelopment
2021-04-23 00:11:46 +00:00
parent 784f009190
commit 4585b1ce1c
65 changed files with 693 additions and 418 deletions

View File

@@ -39,6 +39,7 @@ import java.util.concurrent.ConcurrentSkipListMap;
import java.util.concurrent.Future;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.logging.Level;
import java.util.stream.Collectors;
@@ -539,6 +540,8 @@ public class PlayerInstance extends Playable
/** Stored from last ValidatePosition **/
private final Location _lastServerPosition = new Location(0, 0, 0);
private final AtomicBoolean _blinkActive = new AtomicBoolean();
/** The number of recommendation obtained by the PlayerInstance */
private int _recomHave; // how much I was recommended by others
/** The number of recommendation that the PlayerInstance can give */
@@ -10351,6 +10354,16 @@ public class PlayerInstance extends Playable
return _lastServerPosition;
}
public void setBlinkActive(boolean value)
{
_blinkActive.set(value);
}
public boolean isBlinkActive()
{
return _blinkActive.get();
}
@Override
public void addExpAndSp(double addToExp, double addToSp)
{

View File

@@ -18,7 +18,6 @@ package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.commons.network.PacketReader;
import org.l2jmobius.gameserver.data.xml.DoorData;
import org.l2jmobius.gameserver.geoengine.GeoEngine;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.zone.ZoneId;
@@ -60,10 +59,6 @@ public class ValidatePosition implements IClientIncomingPacket
return;
}
int dx;
int dy;
int dz;
double diffSq;
if (player.isInVehicle())
{
return;
@@ -74,17 +69,16 @@ public class ValidatePosition implements IClientIncomingPacket
return; // Disable validations during fall to avoid "jumping".
}
dx = _x - realX;
dy = _y - realY;
dz = _z - realZ;
diffSq = ((dx * dx) + (dy * dy));
// Don't allow flying transformations outside gracia area!
if (player.isFlyingMounted() && (_x > World.GRACIA_MAX_X))
{
player.untransform();
}
final int dx = _x - realX;
final int dy = _y - realY;
final int dz = _z - realZ;
final double diffSq = ((dx * dx) + (dy * dy));
if (player.isFlying() || player.isInsideZone(ZoneId.WATER))
{
player.setXYZ(realX, realY, _z);
@@ -112,16 +106,14 @@ public class ValidatePosition implements IClientIncomingPacket
// Check out of sync.
if (player.calculateDistance3D(_x, _y, _z) > player.getStat().getMoveSpeed())
{
if (player.isFalling(_z))
if (player.isBlinkActive())
{
final int nearestZ = GeoEngine.getInstance().getHeight(_x, _y, _z);
if (player.getZ() < nearestZ)
{
player.setXYZ(_x, _y, nearestZ);
player.stopMove(null);
}
player.setBlinkActive(false);
}
else
{
player.setXYZ(_x, _y, _z);
}
player.sendPacket(new ValidateLocation(player));
}
player.setClientX(_x);

View File

@@ -62,6 +62,11 @@ public class FlyToLocation implements IClientOutgoingPacket
_destY = destY;
_destZ = destZ;
_type = type;
if (creature.isPlayer())
{
creature.getActingPlayer().setBlinkActive(true);
}
}
public FlyToLocation(Creature creature, int destX, int destY, int destZ, FlyType type, int flySpeed, int flyDelay, int animationSpeed)
@@ -77,6 +82,11 @@ public class FlyToLocation implements IClientOutgoingPacket
_flySpeed = flySpeed;
_flyDelay = flyDelay;
_animationSpeed = animationSpeed;
if (creature.isPlayer())
{
creature.getActingPlayer().setBlinkActive(true);
}
}
public FlyToLocation(Creature creature, ILocational dest, FlyType type)