go to your Move() function, and find byte ToDir = (blah blah blah) and replace it with a much more correct calculation:
Code:
byte ToDir = (byte)((7 - MyMath.PointDirecton(PosX, PosY, Target.LocX, Target.LocY) / 45 % 8));
Code:
if (!Other.PlaceFree(PosX, PosY, ToDir))
return;
Code:
if (!Other.PlaceFree(PosX, PosY, ToDir, (uint)Map))
return;
and replace the code for PlaceFree with:
Code:
public static bool PlaceFree(short X, short Y, byte MoveDir, uint map)
{
bool Ret = true;
switch (MoveDir)
{
case 0: Y += 1; break;
case 1: X -= 1; Y += 1; break;
case 2: X -= 1; break;
case 3: X -= 1;Y -= 1; break;
case 4: Y -= 1; break;
case 5: X += 1; Y -= 1; break;
case 6: X += 1; break;
case 7: Y += 1; X += 1;break;
}
foreach (DictionaryEntry DE in Mobs.AllMobs)
{
SingleMob Mob = (SingleMob)DE.Value;
if(Mob.Map == map)
if (Mob.Alive)
if (Mob.PosX == X)
if (Mob.PosY == Y)
Ret = false;
}
return Ret;
}
}
Code:
short AddX = 0;
short AddY = 0;
Code:
short AddX = 0;
short AddY = 1;






