Fix collision check to use same code as Spawn()
This commit is contained in:
parent
8521241ab7
commit
5600931237
1 changed files with 4 additions and 4 deletions
|
|
@ -1253,12 +1253,12 @@ namespace TShockAPI
|
|||
|
||||
public static bool CheckPlayerCollision(int x, int y)
|
||||
{
|
||||
if (x + 1 <= Main.maxTilesX && y + 3 <= Main.maxTilesY
|
||||
&& x >= 0 && y >= 0)
|
||||
if (x + 2 <= Main.maxTilesX && y <= Main.maxTilesY
|
||||
&& x >= 1 && y >= 3)
|
||||
{
|
||||
for (int i = x; i < x + 2; i++)
|
||||
for (int i = x - 1; i < x + 2; i++)
|
||||
{
|
||||
for (int h = y; h < y + 4; h++)
|
||||
for (int h = y - 3; h < y; h++)
|
||||
{
|
||||
if (!Main.tile[i, h].active || !Main.tileSolid[Main.tile[i, h].type] || Main.tileSolidTop[Main.tile[i, h].type])
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue