Sync with L2JServer Jan 9th 2015.

This commit is contained in:
mobius
2015-01-09 19:55:02 +00:00
parent 9c9b0aaff7
commit 4c2db62a63
618 changed files with 19803 additions and 7853 deletions

View File

@ -19,8 +19,8 @@
package com.l2jserver.gameserver.pathfinding.cellnodes;
import com.l2jserver.gameserver.GeoData;
import com.l2jserver.gameserver.geoengine.Direction;
import com.l2jserver.gameserver.pathfinding.AbstractNodeLoc;
import com.l2jserver.geodriver.Cell;
/**
* @author -Nemesiss-, HorridoJoho
@ -44,10 +44,10 @@ public class NodeLoc extends AbstractNodeLoc
{
_x = x;
_y = y;
_goNorth = GeoData.getInstance().canEnterNeighbors(x, y, z, Direction.NORTH);
_goEast = GeoData.getInstance().canEnterNeighbors(x, y, z, Direction.EAST);
_goSouth = GeoData.getInstance().canEnterNeighbors(x, y, z, Direction.SOUTH);
_goWest = GeoData.getInstance().canEnterNeighbors(x, y, z, Direction.WEST);
_goNorth = GeoData.getInstance().checkNearestNswe(x, y, z, Cell.NSWE_NORTH);
_goEast = GeoData.getInstance().checkNearestNswe(x, y, z, Cell.NSWE_EAST);
_goSouth = GeoData.getInstance().checkNearestNswe(x, y, z, Cell.NSWE_SOUTH);
_goWest = GeoData.getInstance().checkNearestNswe(x, y, z, Cell.NSWE_WEST);
_geoHeight = GeoData.getInstance().getNearestZ(x, y, z);
}
@ -120,28 +120,27 @@ public class NodeLoc extends AbstractNodeLoc
@Override
public int hashCode()
{
final int prime = 31;
int result = 1;
result = (prime * result) + _x;
result = (prime * result) + _y;
byte nswe = 0;
int nswe = 0;
if (canGoNorth())
{
nswe |= 1;
nswe |= Cell.NSWE_NORTH;
}
if (canGoEast())
{
nswe |= 1 << 1;
nswe |= Cell.NSWE_EAST;
}
if (canGoSouth())
{
nswe |= 1 << 2;
nswe |= Cell.NSWE_SOUTH;
}
if (canGoEast())
{
nswe |= 1 << 3;
nswe |= Cell.NSWE_EAST;
}
result = (prime * result) + (((_geoHeight & 0xFFFF) << 1) | nswe);