diff options
author | Bond-009 <bond.009@outlook.com> | 2017-09-25 18:17:45 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2017-09-25 18:17:45 +0200 |
commit | 10c5c1227e5a663b3a53c336cfa6a0a98f874265 (patch) | |
tree | b45f06fd4d7ceaca6807113d58d4aba7166d9aa5 /src/ChunkMap.cpp | |
parent | cBlockArea: Fix performance regression (#4045) (diff) | |
download | cuberite-10c5c1227e5a663b3a53c336cfa6a0a98f874265.tar cuberite-10c5c1227e5a663b3a53c336cfa6a0a98f874265.tar.gz cuberite-10c5c1227e5a663b3a53c336cfa6a0a98f874265.tar.bz2 cuberite-10c5c1227e5a663b3a53c336cfa6a0a98f874265.tar.lz cuberite-10c5c1227e5a663b3a53c336cfa6a0a98f874265.tar.xz cuberite-10c5c1227e5a663b3a53c336cfa6a0a98f874265.tar.zst cuberite-10c5c1227e5a663b3a53c336cfa6a0a98f874265.zip |
Diffstat (limited to 'src/ChunkMap.cpp')
-rw-r--r-- | src/ChunkMap.cpp | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/ChunkMap.cpp b/src/ChunkMap.cpp index dff62f69d..30bab923d 100644 --- a/src/ChunkMap.cpp +++ b/src/ChunkMap.cpp @@ -325,36 +325,33 @@ void cChunkMap::BroadcastBlockAction(Vector3i a_BlockPos, char a_Byte1, char a_B -void cChunkMap::BroadcastBlockBreakAnimation(UInt32 a_EntityID, int a_BlockX, int a_BlockY, int a_BlockZ, char a_Stage, const cClientHandle * a_Exclude) +void cChunkMap::BroadcastBlockBreakAnimation(UInt32 a_EntityID, Vector3i a_BlockPos, char a_Stage, const cClientHandle * a_Exclude) { cCSLock Lock(m_CSChunks); - int ChunkX, ChunkZ; - - cChunkDef::BlockToChunk(a_BlockX, a_BlockZ, ChunkX, ChunkZ); - cChunkPtr Chunk = GetChunkNoGen(ChunkX, ChunkZ); + cChunkCoords ChunkPos = cChunkDef::BlockToChunk(a_BlockPos); + cChunkPtr Chunk = GetChunkNoGen(ChunkPos); if (Chunk == nullptr) { return; } // It's perfectly legal to broadcast packets even to invalid chunks! - Chunk->BroadcastBlockBreakAnimation(a_EntityID, a_BlockX, a_BlockY, a_BlockZ, a_Stage, a_Exclude); + Chunk->BroadcastBlockBreakAnimation(a_EntityID, a_BlockPos, a_Stage, a_Exclude); } -void cChunkMap::BroadcastBlockEntity(int a_BlockX, int a_BlockY, int a_BlockZ, const cClientHandle * a_Exclude) +void cChunkMap::BroadcastBlockEntity(Vector3i a_BlockPos, const cClientHandle * a_Exclude) { cCSLock Lock(m_CSChunks); - int ChunkX, ChunkZ; - cChunkDef::BlockToChunk(a_BlockX, a_BlockZ, ChunkX, ChunkZ); - cChunkPtr Chunk = GetChunkNoGen(ChunkX, ChunkZ); + cChunkCoords ChunkPos = cChunkDef::BlockToChunk(a_BlockPos); + cChunkPtr Chunk = GetChunkNoGen(ChunkPos); if ((Chunk == nullptr) || !Chunk->IsValid()) { return; } - Chunk->BroadcastBlockEntity(a_BlockX, a_BlockY, a_BlockZ, a_Exclude); + Chunk->BroadcastBlockEntity(a_BlockPos, a_Exclude); } |