From 386618adb6134b68df1bf9d05bfcdc371c979f30 Mon Sep 17 00:00:00 2001 From: Deathmax Date: Thu, 2 Jun 2011 13:27:49 +0800 Subject: [PATCH] Hopefully fixed /tp issues. (I hope) --- TShockAPI/TShock.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs index 48344f30..91b60d72 100644 --- a/TShockAPI/TShock.cs +++ b/TShockAPI/TShock.cs @@ -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) {