diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-02-20 17:39:00 +0100 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-02-20 17:39:00 +0100 |
commit | d592882fe0d1e7762470e6b5eff2b14ed26f1e69 (patch) | |
tree | 2a9a9fc2a7f6efe75c19511425ad611ad1996fed /source/cPawn.cpp | |
parent | Using own ASSERT() that logs to file (diff) | |
download | cuberite-d592882fe0d1e7762470e6b5eff2b14ed26f1e69.tar cuberite-d592882fe0d1e7762470e6b5eff2b14ed26f1e69.tar.gz cuberite-d592882fe0d1e7762470e6b5eff2b14ed26f1e69.tar.bz2 cuberite-d592882fe0d1e7762470e6b5eff2b14ed26f1e69.tar.lz cuberite-d592882fe0d1e7762470e6b5eff2b14ed26f1e69.tar.xz cuberite-d592882fe0d1e7762470e6b5eff2b14ed26f1e69.tar.zst cuberite-d592882fe0d1e7762470e6b5eff2b14ed26f1e69.zip |
Diffstat (limited to '')
-rw-r--r-- | source/cPawn.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/source/cPawn.cpp b/source/cPawn.cpp index ff4c957e8..ed16f57bb 100644 --- a/source/cPawn.cpp +++ b/source/cPawn.cpp @@ -80,8 +80,7 @@ void cPawn::TakeDamage( int a_Damage, cEntity* a_Instigator ) cPacket_EntityStatus Status;
Status.m_UniqueID = GetUniqueID();
Status.m_Status = cPacket_EntityStatus::STATUS_TAKEDAMAGE;
- cChunkPtr Chunk = GetWorld()->GetChunk( m_ChunkX, m_ChunkY, m_ChunkZ );
- Chunk->Broadcast( Status );
+ m_World->BroadcastToChunk(m_ChunkX, m_ChunkY, m_ChunkZ, Status);
if (m_Health <= 0)
{
@@ -105,8 +104,7 @@ void cPawn::KilledBy( cEntity* a_Killer ) cPacket_EntityStatus Status;
Status.m_UniqueID = GetUniqueID();
Status.m_Status = cPacket_EntityStatus::STATUS_DIE;
- cChunkPtr Chunk = GetWorld()->GetChunk( m_ChunkX, m_ChunkY, m_ChunkZ );
- Chunk->Broadcast( Status ); // Die
+ m_World->BroadcastToChunk(m_ChunkX, m_ChunkY, m_ChunkZ, Status);
}
@@ -152,12 +150,10 @@ void cPawn::Tick(float a_Dt) void cPawn::SetMetaData(MetaData a_MetaData)
{
- cChunkPtr InChunk = GetWorld()->GetChunk( m_ChunkX, m_ChunkY, m_ChunkZ );
-
//Broadcast new status to clients in the chunk
m_MetaData = a_MetaData;
cPacket_Metadata md(a_MetaData, GetUniqueID());
- InChunk->Broadcast(md);
+ m_World->BroadcastToChunk(m_ChunkX, m_ChunkY, m_ChunkZ, md);
}
|