bounds check for noclip detection
This commit is contained in:
parent
96ea583264
commit
05f0e9d717
1 changed files with 10 additions and 4 deletions
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue