Prevent wall collision issues.

This commit is contained in:
MobiusDev 2018-04-18 23:17:26 +00:00
parent bdb814e7e3
commit 1489c950c1
14 changed files with 49 additions and 245 deletions

View File

@ -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();

View File

@ -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

View File

@ -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();

View File

@ -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

View File

@ -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();

View File

@ -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

View File

@ -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();

View File

@ -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

View File

@ -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();

View File

@ -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

View File

@ -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();

View File

@ -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

View File

@ -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();

View File

@ -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