Prevent wall collision issues.
This commit is contained in:
@@ -16,8 +16,6 @@
|
|||||||
*/
|
*/
|
||||||
package com.l2jmobius.gameserver.geoengine.pathfinding;
|
package com.l2jmobius.gameserver.geoengine.pathfinding;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.concurrent.locks.ReentrantLock;
|
import java.util.concurrent.locks.ReentrantLock;
|
||||||
|
|
||||||
import com.l2jmobius.Config;
|
import com.l2jmobius.Config;
|
||||||
@@ -113,36 +111,6 @@ public class NodeBuffer
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates list of Nodes to show debug path.
|
|
||||||
* @return List<Node> : nodes
|
|
||||||
*/
|
|
||||||
public final List<Node> debugPath()
|
|
||||||
{
|
|
||||||
List<Node> result = new ArrayList<>();
|
|
||||||
|
|
||||||
for (Node n = _current; n.getParent() != null; n = n.getParent())
|
|
||||||
{
|
|
||||||
result.add(n);
|
|
||||||
n.setCost(-n.getCost());
|
|
||||||
}
|
|
||||||
|
|
||||||
for (Node[] nodes : _buffer)
|
|
||||||
{
|
|
||||||
for (Node node : nodes)
|
|
||||||
{
|
|
||||||
if ((node.getLoc() == null) || (node.getCost() <= 0))
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
result.add(node);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
public final boolean isLocked()
|
public final boolean isLocked()
|
||||||
{
|
{
|
||||||
return _lock.tryLock();
|
return _lock.tryLock();
|
||||||
|
@@ -3365,9 +3365,13 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
|||||||
}
|
}
|
||||||
|
|
||||||
m.disregardingGeodata = true;
|
m.disregardingGeodata = true;
|
||||||
x = originalX;
|
|
||||||
y = originalY;
|
// Mobius: Verify destination. Prevents wall collisions issues.
|
||||||
z = originalZ;
|
final Location newDestination = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld());
|
||||||
|
x = newDestination.getX();
|
||||||
|
y = newDestination.getY();
|
||||||
|
z = newDestination.getZ();
|
||||||
|
|
||||||
distance = originalDistance;
|
distance = originalDistance;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@@ -16,8 +16,6 @@
|
|||||||
*/
|
*/
|
||||||
package com.l2jmobius.gameserver.geoengine.pathfinding;
|
package com.l2jmobius.gameserver.geoengine.pathfinding;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.concurrent.locks.ReentrantLock;
|
import java.util.concurrent.locks.ReentrantLock;
|
||||||
|
|
||||||
import com.l2jmobius.Config;
|
import com.l2jmobius.Config;
|
||||||
@@ -113,36 +111,6 @@ public class NodeBuffer
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates list of Nodes to show debug path.
|
|
||||||
* @return List<Node> : nodes
|
|
||||||
*/
|
|
||||||
public final List<Node> debugPath()
|
|
||||||
{
|
|
||||||
List<Node> result = new ArrayList<>();
|
|
||||||
|
|
||||||
for (Node n = _current; n.getParent() != null; n = n.getParent())
|
|
||||||
{
|
|
||||||
result.add(n);
|
|
||||||
n.setCost(-n.getCost());
|
|
||||||
}
|
|
||||||
|
|
||||||
for (Node[] nodes : _buffer)
|
|
||||||
{
|
|
||||||
for (Node node : nodes)
|
|
||||||
{
|
|
||||||
if ((node.getLoc() == null) || (node.getCost() <= 0))
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
result.add(node);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
public final boolean isLocked()
|
public final boolean isLocked()
|
||||||
{
|
{
|
||||||
return _lock.tryLock();
|
return _lock.tryLock();
|
||||||
|
@@ -3365,9 +3365,13 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
|||||||
}
|
}
|
||||||
|
|
||||||
m.disregardingGeodata = true;
|
m.disregardingGeodata = true;
|
||||||
x = originalX;
|
|
||||||
y = originalY;
|
// Mobius: Verify destination. Prevents wall collisions issues.
|
||||||
z = originalZ;
|
final Location newDestination = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld());
|
||||||
|
x = newDestination.getX();
|
||||||
|
y = newDestination.getY();
|
||||||
|
z = newDestination.getZ();
|
||||||
|
|
||||||
distance = originalDistance;
|
distance = originalDistance;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@@ -16,8 +16,6 @@
|
|||||||
*/
|
*/
|
||||||
package com.l2jmobius.gameserver.geoengine.pathfinding;
|
package com.l2jmobius.gameserver.geoengine.pathfinding;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.concurrent.locks.ReentrantLock;
|
import java.util.concurrent.locks.ReentrantLock;
|
||||||
|
|
||||||
import com.l2jmobius.Config;
|
import com.l2jmobius.Config;
|
||||||
@@ -113,36 +111,6 @@ public class NodeBuffer
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates list of Nodes to show debug path.
|
|
||||||
* @return List<Node> : nodes
|
|
||||||
*/
|
|
||||||
public final List<Node> debugPath()
|
|
||||||
{
|
|
||||||
List<Node> result = new ArrayList<>();
|
|
||||||
|
|
||||||
for (Node n = _current; n.getParent() != null; n = n.getParent())
|
|
||||||
{
|
|
||||||
result.add(n);
|
|
||||||
n.setCost(-n.getCost());
|
|
||||||
}
|
|
||||||
|
|
||||||
for (Node[] nodes : _buffer)
|
|
||||||
{
|
|
||||||
for (Node node : nodes)
|
|
||||||
{
|
|
||||||
if ((node.getLoc() == null) || (node.getCost() <= 0))
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
result.add(node);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
public final boolean isLocked()
|
public final boolean isLocked()
|
||||||
{
|
{
|
||||||
return _lock.tryLock();
|
return _lock.tryLock();
|
||||||
|
@@ -3365,9 +3365,13 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
|||||||
}
|
}
|
||||||
|
|
||||||
m.disregardingGeodata = true;
|
m.disregardingGeodata = true;
|
||||||
x = originalX;
|
|
||||||
y = originalY;
|
// Mobius: Verify destination. Prevents wall collisions issues.
|
||||||
z = originalZ;
|
final Location newDestination = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld());
|
||||||
|
x = newDestination.getX();
|
||||||
|
y = newDestination.getY();
|
||||||
|
z = newDestination.getZ();
|
||||||
|
|
||||||
distance = originalDistance;
|
distance = originalDistance;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@@ -16,8 +16,6 @@
|
|||||||
*/
|
*/
|
||||||
package com.l2jmobius.gameserver.geoengine.pathfinding;
|
package com.l2jmobius.gameserver.geoengine.pathfinding;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.concurrent.locks.ReentrantLock;
|
import java.util.concurrent.locks.ReentrantLock;
|
||||||
|
|
||||||
import com.l2jmobius.Config;
|
import com.l2jmobius.Config;
|
||||||
@@ -113,36 +111,6 @@ public class NodeBuffer
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates list of Nodes to show debug path.
|
|
||||||
* @return List<Node> : nodes
|
|
||||||
*/
|
|
||||||
public final List<Node> debugPath()
|
|
||||||
{
|
|
||||||
List<Node> result = new ArrayList<>();
|
|
||||||
|
|
||||||
for (Node n = _current; n.getParent() != null; n = n.getParent())
|
|
||||||
{
|
|
||||||
result.add(n);
|
|
||||||
n.setCost(-n.getCost());
|
|
||||||
}
|
|
||||||
|
|
||||||
for (Node[] nodes : _buffer)
|
|
||||||
{
|
|
||||||
for (Node node : nodes)
|
|
||||||
{
|
|
||||||
if ((node.getLoc() == null) || (node.getCost() <= 0))
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
result.add(node);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
public final boolean isLocked()
|
public final boolean isLocked()
|
||||||
{
|
{
|
||||||
return _lock.tryLock();
|
return _lock.tryLock();
|
||||||
|
@@ -3365,9 +3365,13 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
|||||||
}
|
}
|
||||||
|
|
||||||
m.disregardingGeodata = true;
|
m.disregardingGeodata = true;
|
||||||
x = originalX;
|
|
||||||
y = originalY;
|
// Mobius: Verify destination. Prevents wall collisions issues.
|
||||||
z = originalZ;
|
final Location newDestination = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld());
|
||||||
|
x = newDestination.getX();
|
||||||
|
y = newDestination.getY();
|
||||||
|
z = newDestination.getZ();
|
||||||
|
|
||||||
distance = originalDistance;
|
distance = originalDistance;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@@ -16,8 +16,6 @@
|
|||||||
*/
|
*/
|
||||||
package com.l2jmobius.gameserver.geoengine.pathfinding;
|
package com.l2jmobius.gameserver.geoengine.pathfinding;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.concurrent.locks.ReentrantLock;
|
import java.util.concurrent.locks.ReentrantLock;
|
||||||
|
|
||||||
import com.l2jmobius.Config;
|
import com.l2jmobius.Config;
|
||||||
@@ -113,36 +111,6 @@ public class NodeBuffer
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates list of Nodes to show debug path.
|
|
||||||
* @return List<Node> : nodes
|
|
||||||
*/
|
|
||||||
public final List<Node> debugPath()
|
|
||||||
{
|
|
||||||
List<Node> result = new ArrayList<>();
|
|
||||||
|
|
||||||
for (Node n = _current; n.getParent() != null; n = n.getParent())
|
|
||||||
{
|
|
||||||
result.add(n);
|
|
||||||
n.setCost(-n.getCost());
|
|
||||||
}
|
|
||||||
|
|
||||||
for (Node[] nodes : _buffer)
|
|
||||||
{
|
|
||||||
for (Node node : nodes)
|
|
||||||
{
|
|
||||||
if ((node.getLoc() == null) || (node.getCost() <= 0))
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
result.add(node);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
public final boolean isLocked()
|
public final boolean isLocked()
|
||||||
{
|
{
|
||||||
return _lock.tryLock();
|
return _lock.tryLock();
|
||||||
|
@@ -4383,9 +4383,13 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
|||||||
}
|
}
|
||||||
|
|
||||||
m.disregardingGeodata = true;
|
m.disregardingGeodata = true;
|
||||||
x = originalX;
|
|
||||||
y = originalY;
|
// Mobius: Verify destination. Prevents wall collisions issues.
|
||||||
z = originalZ;
|
final Location newDestination = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, originalX, originalY, originalZ, getInstanceId());
|
||||||
|
x = newDestination.getX();
|
||||||
|
y = newDestination.getY();
|
||||||
|
z = newDestination.getZ();
|
||||||
|
|
||||||
distance = originalDistance;
|
distance = originalDistance;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@@ -16,8 +16,6 @@
|
|||||||
*/
|
*/
|
||||||
package com.l2jmobius.gameserver.geoengine.pathfinding;
|
package com.l2jmobius.gameserver.geoengine.pathfinding;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.concurrent.locks.ReentrantLock;
|
import java.util.concurrent.locks.ReentrantLock;
|
||||||
|
|
||||||
import com.l2jmobius.Config;
|
import com.l2jmobius.Config;
|
||||||
@@ -113,36 +111,6 @@ public class NodeBuffer
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates list of Nodes to show debug path.
|
|
||||||
* @return List<Node> : nodes
|
|
||||||
*/
|
|
||||||
public final List<Node> debugPath()
|
|
||||||
{
|
|
||||||
List<Node> result = new ArrayList<>();
|
|
||||||
|
|
||||||
for (Node n = _current; n.getParent() != null; n = n.getParent())
|
|
||||||
{
|
|
||||||
result.add(n);
|
|
||||||
n.setCost(-n.getCost());
|
|
||||||
}
|
|
||||||
|
|
||||||
for (Node[] nodes : _buffer)
|
|
||||||
{
|
|
||||||
for (Node node : nodes)
|
|
||||||
{
|
|
||||||
if ((node.getLoc() == null) || (node.getCost() <= 0))
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
result.add(node);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
public final boolean isLocked()
|
public final boolean isLocked()
|
||||||
{
|
{
|
||||||
return _lock.tryLock();
|
return _lock.tryLock();
|
||||||
|
@@ -3365,9 +3365,13 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
|||||||
}
|
}
|
||||||
|
|
||||||
m.disregardingGeodata = true;
|
m.disregardingGeodata = true;
|
||||||
x = originalX;
|
|
||||||
y = originalY;
|
// Mobius: Verify destination. Prevents wall collisions issues.
|
||||||
z = originalZ;
|
final Location newDestination = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld());
|
||||||
|
x = newDestination.getX();
|
||||||
|
y = newDestination.getY();
|
||||||
|
z = newDestination.getZ();
|
||||||
|
|
||||||
distance = originalDistance;
|
distance = originalDistance;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@@ -16,8 +16,6 @@
|
|||||||
*/
|
*/
|
||||||
package com.l2jmobius.gameserver.geoengine.pathfinding;
|
package com.l2jmobius.gameserver.geoengine.pathfinding;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.concurrent.locks.ReentrantLock;
|
import java.util.concurrent.locks.ReentrantLock;
|
||||||
|
|
||||||
import com.l2jmobius.Config;
|
import com.l2jmobius.Config;
|
||||||
@@ -113,36 +111,6 @@ public class NodeBuffer
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates list of Nodes to show debug path.
|
|
||||||
* @return List<Node> : nodes
|
|
||||||
*/
|
|
||||||
public final List<Node> debugPath()
|
|
||||||
{
|
|
||||||
List<Node> result = new ArrayList<>();
|
|
||||||
|
|
||||||
for (Node n = _current; n.getParent() != null; n = n.getParent())
|
|
||||||
{
|
|
||||||
result.add(n);
|
|
||||||
n.setCost(-n.getCost());
|
|
||||||
}
|
|
||||||
|
|
||||||
for (Node[] nodes : _buffer)
|
|
||||||
{
|
|
||||||
for (Node node : nodes)
|
|
||||||
{
|
|
||||||
if ((node.getLoc() == null) || (node.getCost() <= 0))
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
result.add(node);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
public final boolean isLocked()
|
public final boolean isLocked()
|
||||||
{
|
{
|
||||||
return _lock.tryLock();
|
return _lock.tryLock();
|
||||||
|
@@ -3365,9 +3365,13 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
|||||||
}
|
}
|
||||||
|
|
||||||
m.disregardingGeodata = true;
|
m.disregardingGeodata = true;
|
||||||
x = originalX;
|
|
||||||
y = originalY;
|
// Mobius: Verify destination. Prevents wall collisions issues.
|
||||||
z = originalZ;
|
final Location newDestination = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld());
|
||||||
|
x = newDestination.getX();
|
||||||
|
y = newDestination.getY();
|
||||||
|
z = newDestination.getZ();
|
||||||
|
|
||||||
distance = originalDistance;
|
distance = originalDistance;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Reference in New Issue
Block a user