From 57a3173a4d577cf50c6fe9577188ad6ae2a0be52 Mon Sep 17 00:00:00 2001 From: Cai <13110818005@qq.com> Date: Fri, 4 Apr 2025 01:58:55 +0800 Subject: [PATCH] fix(SpawnHandler): player "break" after respawning --- TShockAPI/GetDataHandlers.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/TShockAPI/GetDataHandlers.cs b/TShockAPI/GetDataHandlers.cs index a4969cf0..6ed0f8de 100644 --- a/TShockAPI/GetDataHandlers.cs +++ b/TShockAPI/GetDataHandlers.cs @@ -2778,6 +2778,9 @@ namespace TShockAPI return false; } + // spawn the player before teleporting + NetMessage.SendData((int)PacketTypes.PlayerSpawn, -1, args.Player.Index, null, args.Player.Index, (int)PlayerSpawnContext.ReviveFromDeath); + // the player has not changed his spawnpoint yet, so we assert the server-saved spawnpoint // by teleporting the player instead of letting the game use the client's incorrect spawnpoint. TShock.Log.ConsoleDebug(GetString("GetDataHandlers / HandleSpawn force ssc teleport for {0} at ({1},{2})", args.Player.Name, args.TPlayer.SpawnX, args.TPlayer.SpawnY));