bounds check for noclip detection

This commit is contained in:
Deathmax 2011-08-21 00:47:39 +08:00
parent 96ea583264
commit 05f0e9d717

View file

@ -814,6 +814,9 @@ namespace TShockAPI
} }
public static bool CheckPlayerCollision(int x, int y) public static bool CheckPlayerCollision(int x, int y)
{
if (x + 1 <= Main.maxTilesX && y + 3 <= Main.maxTilesY
&& x >= 0 && y >= 0)
{ {
for (int i = x; i < x + 2; i++) for (int i = x; i < x + 2; i++)
{ {
@ -823,6 +826,9 @@ namespace TShockAPI
return false; return false;
} }
} }
}
else
return false;
return true; return true;
} }