From ae42278f1689ce426db5f2845a0687b6004b48a1 Mon Sep 17 00:00:00 2001 From: Deathmax Date: Sun, 5 Jun 2011 16:33:45 +0800 Subject: [PATCH] test fix for teleport. --- TShockAPI/TShock.cs | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs index 66195597..8fd41d0f 100644 --- a/TShockAPI/TShock.cs +++ b/TShockAPI/TShock.cs @@ -570,17 +570,22 @@ namespace TShockAPI public static void Teleport(int ply, int x, int y) { - Main.player[ply].velocity = new Vector2(0, 0); + /*Main.player[ply].velocity = new Vector2(0, 0); NetMessage.SendData(0x0d, -1, -1, "", ply); Main.player[ply].position.X = x; Main.player[ply].position.Y = y - 0x2a; NetMessage.SendData(0x0d, -1, -1, "", ply); - UpdatePlayers(); + UpdatePlayers();*/ + Main.player[ply].position.X = (float)x; + Main.player[ply].position.Y = (float)y; + NetMessage.SendData(0x0d, -1, ply, "", ply); + NetMessage.SendData(0x0d, -1, -1, "", ply); + NetMessage.syncPlayers(); } public static void Teleport(int ply, float x, float y) { - Main.player[ply].position.X = x; + /*Main.player[ply].position.X = x; Main.player[ply].position.Y = y - 0x2a; NetMessage.SendData(0x14, -1, -1, "", 10, x, y); NetMessage.SendData(0x0d, -1, -1, "", ply); @@ -591,7 +596,12 @@ namespace TShockAPI NetMessage.SendData(0xC, -1, -1, "", ply); Main.player[ply].SpawnX = oldx; Main.player[ply].SpawnY = oldy; - UpdatePlayers(); + UpdatePlayers();*/ + Main.player[ply].position.X = x; + Main.player[ply].position.Y = y; + NetMessage.SendData(0x0d, -1, ply, "", ply); + NetMessage.SendData(0x0d, -1, -1, "", ply); + NetMessage.syncPlayers(); } public static void StartInvasion()