diff options
Diffstat (limited to 'src/Entities')
-rw-r--r-- | src/Entities/Player.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp index c580d8293..50fd034a5 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); } @@ -2587,9 +2594,10 @@ bool cPlayer::IsInsideWater() BLOCKTYPE Block; NIBBLETYPE Meta; - m_World->GetBlockTypeMeta(EyePos, Block, Meta); - - if ((Block != E_BLOCK_WATER) && (Block != E_BLOCK_STATIONARY_WATER)) + if ( + !m_World->GetBlockTypeMeta(GetEyePosition().Floor(), Block, Meta) || + ((Block != E_BLOCK_WATER) && (Block != E_BLOCK_STATIONARY_WATER)) + ) { return false; } |