Thanks Fang you were right, I re-looked over the fixes id made and noticed id missed something out, Works fine now.
Code:
public static sbyte[] XDir = new sbyte[] { 0, -1, -1, -1, 0, 1, 1, 1 };
public static sbyte[] YDir = new sbyte[] { 1, 1, 0, -1, -1, -1, 0, 1 };
public static sbyte[] XDirSteed = new sbyte[] { 0, -2, -2, -2, 0, 2, 2, 2, -1, -2, -2, -1, 1, 2, 2, 1, -1, -2, -2, -1, 1, 2, 2, 1 };
public static sbyte[] YDirSteed = new sbyte[] { 2, 2, 0, -2, -2, -2, 0, 2, 2, 1, -1, -2, -2, -1, 1, 2, 2, 1, -1, -2, -2, -1, 1, 2 };
public bool MoveSteed(Enums.ConquerAngle Direction)
{
ushort _X = X, _Y = Y;
int dir = ((int)Direction) % XDirSteed.Length;
Facing = Direction;
sbyte xi = XDirSteed[dir], yi = YDirSteed[dir];
_X = (ushort)(X + xi);
_Y = (ushort)(Y + yi);
Game.Map Map = null;
if (ServerBase.Kernel.Maps.TryGetValue(MapID, out Map))
{
if (Map.Floor[_X, _Y, MapObjType])
{
if (MapObjType == MapObjectType.Monster)
{
Map.Floor[_X, _Y, MapObjType] = false;
Map.Floor[X, Y, MapObjType] = true;
}
X = _X;
Y = _Y;
return true;
}
else
{
if (Mode == Enums.Mode.None)
{
if (EntityFlag != EntityFlag.Monster)
Teleport(MapID, X, Y);
else
return false;
}
}
}
else
{
if (EntityFlag != EntityFlag.Monster)
Teleport(MapID, X, Y);
else
return false;
}
return true;
}
public bool Move(Enums.ConquerAngle Direction)
{
ushort _X = X, _Y = Y;
Facing = Direction;
int dir = ((int)Direction) % XDir.Length;
sbyte xi = XDir[dir], yi = YDir[dir];
_X = (ushort)(X + xi);
_Y = (ushort)(Y + yi);
Game.Map Map = null;
if (ServerBase.Kernel.Maps.TryGetValue(MapID, out Map))
{
var objType = MapObjType;
if (Map.Floor[_X, _Y, objType])
{
if (objType == MapObjectType.Monster)
{
Map.Floor[_X, _Y, MapObjType] = false;
Map.Floor[X, Y, MapObjType] = true;
}
X = _X;
Y = _Y;
return true;
}
else
{
if (Mode == Enums.Mode.None)
if (EntityFlag != EntityFlag.Monster)
Teleport(MapID, X, Y);
else
return false;
return false;
}
}
else
{
if (EntityFlag != EntityFlag.Monster)
Teleport(MapID, X, Y);
else
return false;
}
return true;
}