diff --git a/game-server/src/com/aionemu/gameserver/network/aion/serverpackets/SM_PLAYER_INFO.java b/game-server/src/com/aionemu/gameserver/network/aion/serverpackets/SM_PLAYER_INFO.java index c48066bfe..1bae20301 100644 --- a/game-server/src/com/aionemu/gameserver/network/aion/serverpackets/SM_PLAYER_INFO.java +++ b/game-server/src/com/aionemu/gameserver/network/aion/serverpackets/SM_PLAYER_INFO.java @@ -1,5 +1,8 @@ package com.aionemu.gameserver.network.aion.serverpackets; +import com.aionemu.gameserver.controllers.movement.MovementMask; +import com.aionemu.gameserver.controllers.movement.PlayerMoveController; +import com.aionemu.gameserver.geoEngine.math.Vector3f; import com.aionemu.gameserver.model.actions.PlayerMode; import com.aionemu.gameserver.model.gameobjects.player.CustomPlayerState; import com.aionemu.gameserver.model.gameobjects.player.Player; @@ -162,7 +165,8 @@ protected void writeImpl(AionConnection con) { writeF(playerAppearance.getHeight()); writeF(0.25f); // scale writeF(2.0f); // gravity or slide surface o_O - writeF(player.getGameStats().getMovementSpeedFloat()); // move speed + float movementSpeed = player.getGameStats().getMovementSpeedFloat(); + writeF(movementSpeed); Stat2 attackSpeed = player.getGameStats().getAttackSpeed(); writeH(attackSpeed.getBase()); @@ -171,15 +175,25 @@ protected void writeImpl(AionConnection con) { writeS(player.hasStore() ? player.getStore().getStoreMessage() : ""); // private store message - // Movement - writeF(0); - writeF(0); - writeF(0); - - writeF(player.getX());// x - writeF(player.getY());// y - writeF(player.getZ());// z - writeC(0x00); // move type + PlayerMoveController pmc = player.getMoveController(); + byte movementMask = pmc.getMovementMask(); + if ((pmc.movementMask & MovementMask.ABSOLUTE) == MovementMask.ABSOLUTE) { + // calculate the vector, as click to move and target coords are not supported here + Vector3f vector = new Vector3f(pmc.getTargetX2() - player.getX(), pmc.getTargetY2() - player.getY(), + pmc.getTargetZ2() - player.getZ()).normalizeLocal().multLocal(movementSpeed); + writeF(vector.getX()); + writeF(vector.getY()); + writeF(vector.getZ()); + movementMask &= ~MovementMask.ABSOLUTE; + } else { + writeF(pmc.vectorX); + writeF(pmc.vectorY); + writeF(pmc.vectorZ); + } + writeF(player.getX()); + writeF(player.getY()); + writeF(player.getZ()); + writeC(movementMask); if (player.isUsingFlyTeleport()) { writeD(player.getFlightTeleportId());