Reverted teleport method.

Fixed server.dat corruption
This commit is contained in:
high 2011-08-09 23:24:02 -04:00
parent 074d87d0f7
commit ba67148ed8
2 changed files with 50 additions and 55 deletions

View file

@ -61,19 +61,19 @@ namespace TShockAPI.Net
}
public void Pack(Stream stream)
{
stream.Write(Time);
stream.Write(DayTime);
stream.Write(MoonPhase);
stream.Write(BloodMoon);
stream.Write(MaxTilesX);
stream.Write(MaxTilesY);
stream.Write(SpawnX);
stream.Write(SpawnY);
stream.Write(WorldSurface);
stream.Write(RockLayer);
stream.Write(WorldID);
stream.Write((byte)WorldFlags);
stream.Write(Encoding.ASCII.GetBytes(WorldName));
stream.WriteInt32(Time);
stream.WriteBoolean(DayTime);
stream.WriteInt8(MoonPhase);
stream.WriteBoolean(BloodMoon);
stream.WriteInt32(MaxTilesX);
stream.WriteInt32(MaxTilesY);
stream.WriteInt32(SpawnX);
stream.WriteInt32(SpawnY);
stream.WriteInt32(WorldSurface);
stream.WriteInt32(RockLayer);
stream.WriteInt32(WorldID);
stream.WriteInt8((byte)WorldFlags);
stream.WriteBytes(Encoding.ASCII.GetBytes(WorldName));
}
public void Unpack(Stream stream)

View file

@ -188,8 +188,6 @@ namespace TShockAPI
}
public bool Teleport(int tilex, int tiley)
{
if (!TpLock)
{
InitSpawn = false;
@ -198,7 +196,7 @@ namespace TShockAPI
//150 Should avoid all client crash errors
//The error occurs when a tile trys to update which the client hasnt load yet, Clients only update tiles withen 150 blocks
//Try 300 if it does not work (Higher number - Longer load times - Less chance of error)
if (!SendTileSquare(tilex, tiley))
if (!SendTileSquare(tilex, tiley, 150))
{
SendMessage("Warning, teleport failed due to being too close to the edge of the map.", Color.Red);
return false;
@ -238,9 +236,6 @@ namespace TShockAPI
return true;
}
SendMessage("Cannot teleport due to TP Lock", Color.Red);
return false;
}
public void Spawn()
{