This fix will teleport characters to old position, to avoid cross the floor.
ValidatePosition.java
ValidatePosition.java
- Code:
if (activeChar.isFlying() || activeChar.isInsideZone(L2Character.ZONE_WATER))
{
activeChar.setXYZ(realX, realY, _z);
if (diffSq > 90000)
{
activeChar.sendPacket(new ValidateLocation(activeChar));
}
}
+
+ int deltaZ = activeChar.getZ() - _z;
+ if (deltaZ > 1024)
+ {
+ int zLocation = GeoData.getInstance().getHeight(activeChar.getX(), activeChar.getY(), activeChar.getZ());
+ activeChar.teleToLocation(activeChar.getX(), activeChar.getY(), zLocation);
+ if (activeChar.isGM())
+ {
+ activeChar.sendMessage("Geodata Log (Admin): Last position restored.");
+ }
+ return;
+ }
else if (diffSq < 360000) // if too large, messes observation
{
if (Config.COORD_SYNCHRONIZE == -1) // Only Z coordinate synched to server, mainly used when no geodata
{
activeChar.setXYZ(realX, realY, _z);
return;
}