From 572de5974c7502fbafab1d57f632d5f47d4750ea Mon Sep 17 00:00:00 2001 From: MobiusDevelopment <8391001+MobiusDevelopment@users.noreply.github.com> Date: Thu, 10 Oct 2019 22:51:52 +0000 Subject: [PATCH] Check if you can see target before acquiring it. --- .../gameserver/model/actor/instance/PlayerInstance.java | 1 + .../gameserver/model/actor/instance/PlayerInstance.java | 1 + 2 files changed, 2 insertions(+) diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java index aa9af66624..f65fc99495 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java +++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java @@ -14124,6 +14124,7 @@ public class PlayerInstance extends Playable } // Check if monster is reachable. if (nearby.isAutoAttackable(this) // + && GeoEngine.getInstance().canSeeTarget(this, nearby)// && GeoEngine.getInstance().canMoveToTarget(getX(), getY(), getZ(), nearby.getX(), nearby.getY(), nearby.getZ(), getInstanceWorld())) { final double monsterDistance = calculateDistance2D(nearby); diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java index 6f705db4b9..92ae754a4b 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java @@ -14073,6 +14073,7 @@ public class PlayerInstance extends Playable } // Check if monster is reachable. if (nearby.isAutoAttackable(this) // + && GeoEngine.getInstance().canSeeTarget(this, nearby)// && GeoEngine.getInstance().canMoveToTarget(getX(), getY(), getZ(), nearby.getX(), nearby.getY(), nearby.getZ(), getInstanceWorld())) { final double monsterDistance = calculateDistance2D(nearby);