diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/WalkInfo.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/WalkInfo.java index 22cfd07cc9..4e8be61b76 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/WalkInfo.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/WalkInfo.java @@ -57,7 +57,7 @@ public class WalkInfo */ public L2NpcWalkerNode getCurrentNode() { - return getRoute().getNodeList().get(_currentNode); + return getRoute().getNodeList().get(Math.min(Math.max(0, _currentNode), getRoute().getNodeList().size() - 1)); } /** diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/WalkInfo.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/WalkInfo.java index 22cfd07cc9..4e8be61b76 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/WalkInfo.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/WalkInfo.java @@ -57,7 +57,7 @@ public class WalkInfo */ public L2NpcWalkerNode getCurrentNode() { - return getRoute().getNodeList().get(_currentNode); + return getRoute().getNodeList().get(Math.min(Math.max(0, _currentNode), getRoute().getNodeList().size() - 1)); } /** diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/WalkInfo.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/WalkInfo.java index 22cfd07cc9..4e8be61b76 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/WalkInfo.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/WalkInfo.java @@ -57,7 +57,7 @@ public class WalkInfo */ public L2NpcWalkerNode getCurrentNode() { - return getRoute().getNodeList().get(_currentNode); + return getRoute().getNodeList().get(Math.min(Math.max(0, _currentNode), getRoute().getNodeList().size() - 1)); } /** diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/WalkInfo.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/WalkInfo.java index 22cfd07cc9..4e8be61b76 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/WalkInfo.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/WalkInfo.java @@ -57,7 +57,7 @@ public class WalkInfo */ public L2NpcWalkerNode getCurrentNode() { - return getRoute().getNodeList().get(_currentNode); + return getRoute().getNodeList().get(Math.min(Math.max(0, _currentNode), getRoute().getNodeList().size() - 1)); } /** diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/WalkInfo.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/WalkInfo.java index bfa4e9f67e..67569455f9 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/WalkInfo.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/WalkInfo.java @@ -57,7 +57,7 @@ public class WalkInfo */ public L2NpcWalkerNode getCurrentNode() { - return getRoute().getNodeList().get(_currentNode); + return getRoute().getNodeList().get(Math.min(Math.max(0, _currentNode), getRoute().getNodeList().size() - 1)); } /** diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/WalkInfo.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/WalkInfo.java index 22cfd07cc9..4e8be61b76 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/WalkInfo.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/WalkInfo.java @@ -57,7 +57,7 @@ public class WalkInfo */ public L2NpcWalkerNode getCurrentNode() { - return getRoute().getNodeList().get(_currentNode); + return getRoute().getNodeList().get(Math.min(Math.max(0, _currentNode), getRoute().getNodeList().size() - 1)); } /** diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/WalkInfo.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/WalkInfo.java index 22cfd07cc9..4e8be61b76 100644 --- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/WalkInfo.java +++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/WalkInfo.java @@ -57,7 +57,7 @@ public class WalkInfo */ public L2NpcWalkerNode getCurrentNode() { - return getRoute().getNodeList().get(_currentNode); + return getRoute().getNodeList().get(Math.min(Math.max(0, _currentNode), getRoute().getNodeList().size() - 1)); } /**