Merge pull request #435 from k0rd/noclip-devel
Workaround for buggy noclip detection in water
This commit is contained in:
commit
c474dca304
2 changed files with 19 additions and 2 deletions
|
|
@ -52,7 +52,14 @@ namespace TShockAPI.DB
|
|||
{
|
||||
if (reader.Read())
|
||||
{
|
||||
return new Vector2(reader.Get<int>("X"), reader.Get<int>("Y"));
|
||||
int checkX=reader.Get<int>("X");
|
||||
int checkY=reader.Get<int>("Y");
|
||||
//fix leftover inconsistancies
|
||||
if (checkX==0)
|
||||
checkX++;
|
||||
if (checkY==0)
|
||||
checkY++;
|
||||
return new Vector2(checkX, checkY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -92,6 +99,7 @@ namespace TShockAPI.DB
|
|||
{
|
||||
try
|
||||
{
|
||||
if ((X != 0) && ( Y !=0)) //invalid pos!
|
||||
database.Query("INSERT INTO RememberedPos (Name, IP, X, Y, WorldID) VALUES (@0, @1, @2, @3, @4);", name, IP, X, Y , Main.worldID.ToString());
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
|
@ -103,6 +111,7 @@ namespace TShockAPI.DB
|
|||
{
|
||||
try
|
||||
{
|
||||
if ((X != 0) && ( Y !=0)) //invalid pos!
|
||||
database.Query("UPDATE RememberedPos SET X = @0, Y = @1, IP = @2 WHERE Name = @3 AND WorldID = @4;", X, Y, IP, name, Main.worldID.ToString());
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
|
|
|||
|
|
@ -472,11 +472,19 @@ namespace TShockAPI
|
|||
{
|
||||
num4 = Main.maxTilesY;
|
||||
}
|
||||
for (int c = num; c < num2; c++)
|
||||
{
|
||||
for (int d = num3; d< num4; d++)
|
||||
{
|
||||
if (Main.tile[c,d].liquid != 0)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
for (int i = num; i < num2; i++)
|
||||
{
|
||||
for (int j = num3; j < num4; j++)
|
||||
{
|
||||
if (Main.tile[i, j] != null && Main.tile[i, j].active && Main.tileSolid[(int)Main.tile[i, j].type] && !Main.tileSolidTop[(int)Main.tile[i, j].type] &&(((int)Main.tile[i,j].type !=53) && ((int)Main.tile[i,j].type !=112) && ((int)Main.tile[i,j].type !=116) && ((int)Main.tile[i,j].type !=123)) && ((Main.tile[i,j].liquid == 0 )&& !Main.tile[i,j].lava))
|
||||
if (Main.tile[i, j] != null && Main.tile[i, j].active && Main.tileSolid[(int)Main.tile[i, j].type] && !Main.tileSolidTop[(int)Main.tile[i, j].type] &&(((int)Main.tile[i,j].type !=53) && ((int)Main.tile[i,j].type !=112) && ((int)Main.tile[i,j].type !=116) && ((int)Main.tile[i,j].type !=123)) && !Main.tile[i,j].lava)
|
||||
{
|
||||
Vector2 vector;
|
||||
vector.X = (float)(i * 16);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue