diff options
-rw-r--r-- | src/ClientHandle.h | 2 | ||||
-rw-r--r-- | src/Mobs/Blaze.cpp | 1 | ||||
-rw-r--r-- | src/Mobs/Ghast.cpp | 1 | ||||
-rw-r--r-- | src/Mobs/Path.cpp | 2 | ||||
-rw-r--r-- | src/Mobs/Skeleton.cpp | 1 | ||||
-rw-r--r-- | src/Server.h | 2 |
6 files changed, 3 insertions, 6 deletions
diff --git a/src/ClientHandle.h b/src/ClientHandle.h index d7468d345..22d052f22 100644 --- a/src/ClientHandle.h +++ b/src/ClientHandle.h @@ -415,7 +415,7 @@ private: int m_LastStreamedChunkZ; /** Number of ticks since the last network packet was received (increased in Tick(), reset in OnReceivedData()) */ - int m_TicksSinceLastPacket; + std::atomic<int> m_TicksSinceLastPacket; /** Duration of the last completed client ping. */ std::chrono::steady_clock::duration m_Ping; diff --git a/src/Mobs/Blaze.cpp b/src/Mobs/Blaze.cpp index a772d830c..bd3b3f776 100644 --- a/src/Mobs/Blaze.cpp +++ b/src/Mobs/Blaze.cpp @@ -50,7 +50,6 @@ bool cBlaze::Attack(std::chrono::milliseconds a_Dt) FireCharge = nullptr; return false; } - m_World->BroadcastSpawnEntity(*FireCharge); ResetAttackCooldown(); // ToDo: Shoot 3 fireballs instead of 1. return true; diff --git a/src/Mobs/Ghast.cpp b/src/Mobs/Ghast.cpp index 9ac16866e..61813d0fe 100644 --- a/src/Mobs/Ghast.cpp +++ b/src/Mobs/Ghast.cpp @@ -50,7 +50,6 @@ bool cGhast::Attack(std::chrono::milliseconds a_Dt) GhastBall = nullptr; return false; } - m_World->BroadcastSpawnEntity(*GhastBall); ResetAttackCooldown(); return true; } diff --git a/src/Mobs/Path.cpp b/src/Mobs/Path.cpp index 03f0ad31a..4db93050e 100644 --- a/src/Mobs/Path.cpp +++ b/src/Mobs/Path.cpp @@ -327,7 +327,7 @@ void cPath::BuildPath() { // Waypoints are cylinders that start at some particular x, y, z and have infinite height. // Submerging water waypoints allows swimming mobs to be able to touch them. - if (GetCell(CurrentCell->m_Location + Vector3i(0, -1, 0))->m_BlockType == E_BLOCK_STATIONARY_WATER) + if (IsBlockWater(GetCell(CurrentCell->m_Location + Vector3i(0, -1, 0))->m_BlockType)) { CurrentCell->m_Location.y -= 30; } diff --git a/src/Mobs/Skeleton.cpp b/src/Mobs/Skeleton.cpp index 5032ec5b0..adad543d2 100644 --- a/src/Mobs/Skeleton.cpp +++ b/src/Mobs/Skeleton.cpp @@ -68,7 +68,6 @@ bool cSkeleton::Attack(std::chrono::milliseconds a_Dt) Arrow = nullptr; return false; } - m_World->BroadcastSpawnEntity(*Arrow); ResetAttackCooldown(); return true; diff --git a/src/Server.h b/src/Server.h index 4d0bc1c18..9131697c2 100644 --- a/src/Server.h +++ b/src/Server.h @@ -189,7 +189,7 @@ private: bool m_bIsConnected; // true - connected false - not connected - bool m_bRestarting; + std::atomic<bool> m_bRestarting; /** The private key used for the assymetric encryption start in the protocols */ cRsaPrivateKey m_PrivateKey; |