From 752881911798e3551cbd3712ac098d1c3f7d0767 Mon Sep 17 00:00:00 2001 From: "admin@omencraft.com" Date: Thu, 10 Nov 2011 20:04:20 +0000 Subject: Fixed logging in underground bug this time. A hack, but it works. :D git-svn-id: http://mc-server.googlecode.com/svn/trunk@90 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cClientHandle.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source') diff --git a/source/cClientHandle.cpp b/source/cClientHandle.cpp index 655048180..a399441de 100644 --- a/source/cClientHandle.cpp +++ b/source/cClientHandle.cpp @@ -450,7 +450,9 @@ void cClientHandle::HandlePacket( cPacket* a_Packet ) cPacket_Chat Joined( m_pState->Username + " joined the game!"); cRoot::Get()->GetServer()->Broadcast( Joined, this ); } - + int posx = m_Player->GetPosX(); + int posy = m_Player->GetPosY(); + int posz = m_Player->GetPosZ(); // Now initialize player (adds to entity list etc.) cWorld* PlayerWorld = cRoot::Get()->GetWorld( m_Player->GetLoadedWorldName() ); if( !PlayerWorld ) PlayerWorld = cRoot::Get()->GetDefaultWorld(); @@ -465,6 +467,7 @@ void cClientHandle::HandlePacket( cPacket* a_Packet ) // Then we can start doing more stuffs! :D m_bLoggedIn = true; LOG("%s completely logged in", GetUsername() ); + m_Player->TeleportTo( posx, posy, posz ); StreamChunks(); } break; @@ -1195,9 +1198,6 @@ void cClientHandle::Tick(float a_Dt) Send( cPacket_UpdateHealth( (short)m_Player->GetHealth() ) ); World->UnlockEntities(); - - //quick bugfix to prevent players from spawning in ground - m_Player->TeleportTo( m_Player->GetPosX(), m_Player->GetPosY()+2, m_Player->GetPosZ() ); } } -- cgit v1.2.3