Fix collision check to use same code as Spawn()

This commit is contained in:
Zidonuke 2011-12-28 23:33:57 -05:00
parent 8521241ab7
commit 5600931237

View file

@ -1253,12 +1253,12 @@ 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 if (x + 2 <= Main.maxTilesX && y <= Main.maxTilesY
&& x >= 0 && y >= 0) && 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]) if (!Main.tile[i, h].active || !Main.tileSolid[Main.tile[i, h].type] || Main.tileSolidTop[Main.tile[i, h].type])
return false; return false;