From 885d80ccdb97c984abe85eaeaecf1aedc3e36d25 Mon Sep 17 00:00:00 2001 From: Mattes D Date: Thu, 15 Jun 2017 17:06:50 +0200 Subject: Entity: Replaced a mutexed counter with a std::atomic. (#3773) --- src/Entities/Entity.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/Entities/Entity.h') diff --git a/src/Entities/Entity.h b/src/Entities/Entity.h index b7778e797..4310b1567 100644 --- a/src/Entities/Entity.h +++ b/src/Entities/Entity.h @@ -32,7 +32,12 @@ #define POSZ_TOINT FloorC(GetPosZ()) #define POS_TOINT GetPosition().Floor() -#define GET_AND_VERIFY_CURRENT_CHUNK(ChunkVarName, X, Z) cChunk * ChunkVarName = a_Chunk.GetNeighborChunk(X, Z); if ((ChunkVarName == nullptr) || !ChunkVarName->IsValid()) { return; } +#define GET_AND_VERIFY_CURRENT_CHUNK(ChunkVarName, X, Z) \ + cChunk * ChunkVarName = a_Chunk.GetNeighborChunk(X, Z); \ + if ((ChunkVarName == nullptr) || !ChunkVarName->IsValid()) \ + { \ + return; \ + } @@ -518,9 +523,6 @@ protected: bool m_ShouldPreventTeleportation; }; - static cCriticalSection m_CSCount; - static UInt32 m_EntityCount; - /** Measured in meters / second (m / s) */ Vector3d m_Speed; -- cgit v1.2.3