Hopefully fixed /tp issues. (I hope)

This commit is contained in:
Deathmax 2011-06-02 13:27:49 +08:00
parent 4eea752b3d
commit 386618adb6

View file

@ -574,6 +574,7 @@ namespace TShockAPI
Main.player[ply].position.X = x;
Main.player[ply].position.Y = y - 0x2a;
NetMessage.SendData(0x0d, -1, -1, "", ply);
UpdatePlayers();
}
public static void Teleport(int ply, float x, float y)
@ -588,6 +589,7 @@ namespace TShockAPI
NetMessage.SendData(0xC, -1, -1, "", ply);
Main.player[ply].SpawnX = oldx;
Main.player[ply].SpawnY = oldy;
UpdatePlayers();
}
public static void StartInvasion()
@ -656,6 +658,15 @@ namespace TShockAPI
}
}
public static void UpdatePlayers()
{
for (int i = 0; i < Main.player.Length; i++)
{
for (int h = 0; h < Main.player.Length; h++)
NetMessage.SendData(0x0d, i, -1, "", h);
}
}
//TODO : Notify the player if there is more than one match. (or do we want a First() kinda thing?)
public static int GetNPCID(string name, bool exact = false)
{