Improved movement while flying.

This commit is contained in:
MobiusDev
2019-02-18 09:51:14 +00:00
parent 5d04f7dd9f
commit 4cc0015d3c
43 changed files with 54 additions and 54 deletions

View File

@@ -740,7 +740,7 @@ public class L2AttackableAI extends L2CharacterAI
}
// Move the actor to Location (x,y,z) server side AND client side by sending Server->Client packet CharMoveToLocation (broadcast)
final Location moveLoc = GeoEngine.getInstance().canMoveToTargetLoc(npc.getX(), npc.getY(), npc.getZ(), x1, y1, z1, npc.getInstanceId());
final Location moveLoc = _actor.isFlying() ? new Location(x1, y1, z1) : GeoEngine.getInstance().canMoveToTargetLoc(npc.getX(), npc.getY(), npc.getZ(), x1, y1, z1, npc.getInstanceId());
moveTo(moveLoc.getX(), moveLoc.getY(), moveLoc.getZ());
}

View File

@@ -359,7 +359,7 @@ public class GeoEngine
*/
public final boolean canSeeTarget(L2Object origin, L2Object target)
{
if (target.isDoor())
if (target.isDoor() || (target.isCharacter() && ((L2Character) target).isFlying()))
{
return true;
}

View File

@@ -2631,7 +2631,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
*/
public boolean isAttackingDisabled()
{
return _isFlying || isStunned() || isSleeping() || isAttackingNow() || isAlikeDead() || isParalyzed() || isPhysicalAttackMuted() || _AIdisabled;
return isStunned() || isSleeping() || isAttackingNow() || isAlikeDead() || isParalyzed() || isPhysicalAttackMuted() || _AIdisabled;
}
public final Calculator[] getCalculators()
@@ -3931,7 +3931,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
// Z coordinate will follow client values
dz = m._zDestination - zPrev;
if (isPlayer())
if (isPlayer() && !_isFlying)
{
final double distance = Math.hypot(dx, dy);
if (_cursorKeyMovement // In case of cursor movement, avoid moving through obstacles.