Prevent wall collision issues.
This commit is contained in:
parent
bdb814e7e3
commit
1489c950c1
@ -16,8 +16,6 @@
|
||||
*/
|
||||
package com.l2jmobius.gameserver.geoengine.pathfinding;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
import com.l2jmobius.Config;
|
||||
@ -113,36 +111,6 @@ public class NodeBuffer
|
||||
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()
|
||||
{
|
||||
return _lock.tryLock();
|
||||
|
@ -3365,9 +3365,13 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
}
|
||||
|
||||
m.disregardingGeodata = true;
|
||||
x = originalX;
|
||||
y = originalY;
|
||||
z = originalZ;
|
||||
|
||||
// Mobius: Verify destination. Prevents wall collisions issues.
|
||||
final Location newDestination = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld());
|
||||
x = newDestination.getX();
|
||||
y = newDestination.getY();
|
||||
z = newDestination.getZ();
|
||||
|
||||
distance = originalDistance;
|
||||
}
|
||||
else
|
||||
|
@ -16,8 +16,6 @@
|
||||
*/
|
||||
package com.l2jmobius.gameserver.geoengine.pathfinding;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
import com.l2jmobius.Config;
|
||||
@ -113,36 +111,6 @@ public class NodeBuffer
|
||||
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()
|
||||
{
|
||||
return _lock.tryLock();
|
||||
|
@ -3365,9 +3365,13 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
}
|
||||
|
||||
m.disregardingGeodata = true;
|
||||
x = originalX;
|
||||
y = originalY;
|
||||
z = originalZ;
|
||||
|
||||
// Mobius: Verify destination. Prevents wall collisions issues.
|
||||
final Location newDestination = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld());
|
||||
x = newDestination.getX();
|
||||
y = newDestination.getY();
|
||||
z = newDestination.getZ();
|
||||
|
||||
distance = originalDistance;
|
||||
}
|
||||
else
|
||||
|
@ -16,8 +16,6 @@
|
||||
*/
|
||||
package com.l2jmobius.gameserver.geoengine.pathfinding;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
import com.l2jmobius.Config;
|
||||
@ -113,36 +111,6 @@ public class NodeBuffer
|
||||
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()
|
||||
{
|
||||
return _lock.tryLock();
|
||||
|
@ -3365,9 +3365,13 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
}
|
||||
|
||||
m.disregardingGeodata = true;
|
||||
x = originalX;
|
||||
y = originalY;
|
||||
z = originalZ;
|
||||
|
||||
// Mobius: Verify destination. Prevents wall collisions issues.
|
||||
final Location newDestination = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld());
|
||||
x = newDestination.getX();
|
||||
y = newDestination.getY();
|
||||
z = newDestination.getZ();
|
||||
|
||||
distance = originalDistance;
|
||||
}
|
||||
else
|
||||
|
@ -16,8 +16,6 @@
|
||||
*/
|
||||
package com.l2jmobius.gameserver.geoengine.pathfinding;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
import com.l2jmobius.Config;
|
||||
@ -113,36 +111,6 @@ public class NodeBuffer
|
||||
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()
|
||||
{
|
||||
return _lock.tryLock();
|
||||
|
@ -3365,9 +3365,13 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
}
|
||||
|
||||
m.disregardingGeodata = true;
|
||||
x = originalX;
|
||||
y = originalY;
|
||||
z = originalZ;
|
||||
|
||||
// Mobius: Verify destination. Prevents wall collisions issues.
|
||||
final Location newDestination = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld());
|
||||
x = newDestination.getX();
|
||||
y = newDestination.getY();
|
||||
z = newDestination.getZ();
|
||||
|
||||
distance = originalDistance;
|
||||
}
|
||||
else
|
||||
|
@ -16,8 +16,6 @@
|
||||
*/
|
||||
package com.l2jmobius.gameserver.geoengine.pathfinding;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
import com.l2jmobius.Config;
|
||||
@ -113,36 +111,6 @@ public class NodeBuffer
|
||||
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()
|
||||
{
|
||||
return _lock.tryLock();
|
||||
|
@ -4383,9 +4383,13 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
}
|
||||
|
||||
m.disregardingGeodata = true;
|
||||
x = originalX;
|
||||
y = originalY;
|
||||
z = originalZ;
|
||||
|
||||
// Mobius: Verify destination. Prevents wall collisions issues.
|
||||
final Location newDestination = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, originalX, originalY, originalZ, getInstanceId());
|
||||
x = newDestination.getX();
|
||||
y = newDestination.getY();
|
||||
z = newDestination.getZ();
|
||||
|
||||
distance = originalDistance;
|
||||
}
|
||||
else
|
||||
|
@ -16,8 +16,6 @@
|
||||
*/
|
||||
package com.l2jmobius.gameserver.geoengine.pathfinding;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
import com.l2jmobius.Config;
|
||||
@ -113,36 +111,6 @@ public class NodeBuffer
|
||||
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()
|
||||
{
|
||||
return _lock.tryLock();
|
||||
|
@ -3365,9 +3365,13 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
}
|
||||
|
||||
m.disregardingGeodata = true;
|
||||
x = originalX;
|
||||
y = originalY;
|
||||
z = originalZ;
|
||||
|
||||
// Mobius: Verify destination. Prevents wall collisions issues.
|
||||
final Location newDestination = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld());
|
||||
x = newDestination.getX();
|
||||
y = newDestination.getY();
|
||||
z = newDestination.getZ();
|
||||
|
||||
distance = originalDistance;
|
||||
}
|
||||
else
|
||||
|
@ -16,8 +16,6 @@
|
||||
*/
|
||||
package com.l2jmobius.gameserver.geoengine.pathfinding;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
import com.l2jmobius.Config;
|
||||
@ -113,36 +111,6 @@ public class NodeBuffer
|
||||
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()
|
||||
{
|
||||
return _lock.tryLock();
|
||||
|
@ -3365,9 +3365,13 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
}
|
||||
|
||||
m.disregardingGeodata = true;
|
||||
x = originalX;
|
||||
y = originalY;
|
||||
z = originalZ;
|
||||
|
||||
// Mobius: Verify destination. Prevents wall collisions issues.
|
||||
final Location newDestination = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld());
|
||||
x = newDestination.getX();
|
||||
y = newDestination.getY();
|
||||
z = newDestination.getZ();
|
||||
|
||||
distance = originalDistance;
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user