From 2786ad306abe7487e3fc6bed1123ca8ebc2c3198 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Mon, 19 Mar 2012 17:15:35 +0000 Subject: Fixed player heads always pointing north (new EntityHeadLook packet) git-svn-id: http://mc-server.googlecode.com/svn/trunk@424 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cPlayer.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'source/cPlayer.cpp') diff --git a/source/cPlayer.cpp b/source/cPlayer.cpp index 9d1fe7ea4..cf007bb98 100644 --- a/source/cPlayer.cpp +++ b/source/cPlayer.cpp @@ -69,6 +69,10 @@ cPlayer::cPlayer(cClientHandle* a_Client, const AString & a_PlayerName) , m_Color('-') , m_ClientHandle( a_Client ) { + LOGD("Created a player object for \"%s\" @ \"%s\" at %p, ID %d", + a_PlayerName.c_str(), a_Client->GetSocket().GetIPString().c_str(), + this, GetUniqueID() + ); m_EntityType = eEntityType_Player; SetMaxHealth(20); SetMaxFoodLevel(125); @@ -113,7 +117,7 @@ void cPlayer::Initialize( cWorld* a_World ) cPlayer::~cPlayer(void) { - LOG("Deleting cPlayer \"%s\" @ %p", m_PlayerName.c_str(), this); + LOG("Deleting cPlayer \"%s\" at %p, ID %d", m_PlayerName.c_str(), this, GetUniqueID()); SaveToDisk(); @@ -183,8 +187,10 @@ void cPlayer::Tick(float a_Dt) if (m_bDirtyOrientation && !m_bDirtyPosition) { - cPacket_EntityLook EntityLook( this ); + cPacket_EntityLook EntityLook(*this); m_World->BroadcastToChunk(m_ChunkX, m_ChunkY, m_ChunkZ, EntityLook, m_ClientHandle ); + cPacket_EntityHeadLook EntityHeadLook(*this); + m_World->BroadcastToChunk(m_ChunkX, m_ChunkY, m_ChunkZ, EntityHeadLook, m_ClientHandle); m_bDirtyOrientation = false; } else if (m_bDirtyPosition ) -- cgit v1.2.3