summaryrefslogtreecommitdiffstats
path: root/source/cPlayer.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-02-02 22:13:24 +0100
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-02-02 22:13:24 +0100
commitf86d796295c366d2715921797c2a153ed56728fd (patch)
tree29860b621d7bdb50fddedcadf19b5b2d1d56c413 /source/cPlayer.cpp
parentSocket-related assert fixes (diff)
downloadcuberite-f86d796295c366d2715921797c2a153ed56728fd.tar
cuberite-f86d796295c366d2715921797c2a153ed56728fd.tar.gz
cuberite-f86d796295c366d2715921797c2a153ed56728fd.tar.bz2
cuberite-f86d796295c366d2715921797c2a153ed56728fd.tar.lz
cuberite-f86d796295c366d2715921797c2a153ed56728fd.tar.xz
cuberite-f86d796295c366d2715921797c2a153ed56728fd.tar.zst
cuberite-f86d796295c366d2715921797c2a153ed56728fd.zip
Diffstat (limited to '')
-rw-r--r--source/cPlayer.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/source/cPlayer.cpp b/source/cPlayer.cpp
index d336a4616..fa833ff47 100644
--- a/source/cPlayer.cpp
+++ b/source/cPlayer.cpp
@@ -158,16 +158,17 @@ void cPlayer::SpawnOn( cClientHandle* a_Target )
void cPlayer::Tick(float a_Dt)
{
cChunk* InChunk = GetWorld()->GetChunk( m_ChunkX, m_ChunkY, m_ChunkZ );
- if( !InChunk ) return;
+ if ( !InChunk ) return;
cPawn::Tick(a_Dt);
- if(m_bDirtyOrientation && !m_bDirtyPosition)
+ if (m_bDirtyOrientation && !m_bDirtyPosition)
{
cPacket_EntityLook EntityLook( this );
InChunk->Broadcast( EntityLook, m_ClientHandle );
m_bDirtyOrientation = false;
- } else if(m_bDirtyPosition )
+ }
+ else if(m_bDirtyPosition )
{
cRoot::Get()->GetPluginManager()->CallHook( cPluginManager::E_PLUGIN_PLAYER_MOVE, 1, this );
@@ -242,12 +243,14 @@ void cPlayer::Tick(float a_Dt)
cTimer t1;
// Send Player List (Once per m_LastPlayerListTime/1000 ms)
- if (m_LastPlayerListTime + cPlayer::PLAYER_LIST_TIME_MS <= t1.GetNowTime()) {
+ if (m_LastPlayerListTime + cPlayer::PLAYER_LIST_TIME_MS <= t1.GetNowTime())
+ {
cWorld::PlayerList PlayerList = cRoot::Get()->GetWorld()->GetAllPlayers();
- for( cWorld::PlayerList::iterator itr = PlayerList.begin(); itr != PlayerList.end(); ++itr )
+ for( cWorld::PlayerList::iterator itr = PlayerList.begin(); itr != PlayerList.end(); ++itr)
{
- if ((*itr) && (*itr)->GetClientHandle() && !((*itr)->GetClientHandle()->IsDestroyed())) {
- cPacket_PlayerListItem PlayerListItem(GetColor() + GetName(), true, GetClientHandle()->GetPing());
+ if ((*itr) && (*itr)->GetClientHandle() && !((*itr)->GetClientHandle()->IsDestroyed()))
+ {
+ cPacket_PlayerListItem PlayerListItem(GetColor() + m_pState->PlayerName, true, GetClientHandle()->GetPing());
(*itr)->GetClientHandle()->Send( PlayerListItem );
}
}