summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsleirsgoevy <sleirsgoevy@gmail.com>2024-11-01 23:20:13 +0100
committerGitHub <noreply@github.com>2024-11-01 23:20:13 +0100
commit7e4abd7dd09ed8f88471db7369c9e8fb5247416f (patch)
tree314f7bdcd4971b60c7b8b2fc18681ba940741613
parentSave changed maps every 5 minutes (#5557) (diff)
downloadcuberite-7e4abd7dd09ed8f88471db7369c9e8fb5247416f.tar
cuberite-7e4abd7dd09ed8f88471db7369c9e8fb5247416f.tar.gz
cuberite-7e4abd7dd09ed8f88471db7369c9e8fb5247416f.tar.bz2
cuberite-7e4abd7dd09ed8f88471db7369c9e8fb5247416f.tar.lz
cuberite-7e4abd7dd09ed8f88471db7369c9e8fb5247416f.tar.xz
cuberite-7e4abd7dd09ed8f88471db7369c9e8fb5247416f.tar.zst
cuberite-7e4abd7dd09ed8f88471db7369c9e8fb5247416f.zip
-rw-r--r--src/Entities/Player.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp
index c580d8293..de99a299d 100644
--- a/src/Entities/Player.cpp
+++ b/src/Entities/Player.cpp
@@ -982,6 +982,13 @@ void cPlayer::Respawn(void)
TeleportToCoords(m_RespawnPosition.x, m_RespawnPosition.y, m_RespawnPosition.z);
}
+ // The Notchian client enters a weird glitched state when trying to "resurrect" dead players
+ // To prevent that, destroy the existing client-side entity, and create a new one with the same ID
+ // This does not make any difference to more modern clients
+ m_World->BroadcastDestroyEntity(*this, &*m_ClientHandle);
+ m_World->BroadcastSpawnEntity(*this, &*m_ClientHandle);
+
+
SetVisible(true);
}