diff options
author | r.ramazanov <r.ramazanov@servplus.ru> | 2014-04-23 16:15:28 +0200 |
---|---|---|
committer | r.ramazanov <r.ramazanov@servplus.ru> | 2014-04-23 16:15:28 +0200 |
commit | 103c867f1f42c38df3d2bfba2ffbc4c8e7ac2932 (patch) | |
tree | b17cb676477be05abac7084bc0e1e49f651c2456 /src/DeadlockDetect.cpp | |
parent | Mobs shouldn't burn when it's Raining #906 (diff) | |
parent | Merge pull request #925 from archshift/master (diff) | |
download | cuberite-103c867f1f42c38df3d2bfba2ffbc4c8e7ac2932.tar cuberite-103c867f1f42c38df3d2bfba2ffbc4c8e7ac2932.tar.gz cuberite-103c867f1f42c38df3d2bfba2ffbc4c8e7ac2932.tar.bz2 cuberite-103c867f1f42c38df3d2bfba2ffbc4c8e7ac2932.tar.lz cuberite-103c867f1f42c38df3d2bfba2ffbc4c8e7ac2932.tar.xz cuberite-103c867f1f42c38df3d2bfba2ffbc4c8e7ac2932.tar.zst cuberite-103c867f1f42c38df3d2bfba2ffbc4c8e7ac2932.zip |
Diffstat (limited to 'src/DeadlockDetect.cpp')
-rw-r--r-- | src/DeadlockDetect.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/DeadlockDetect.cpp b/src/DeadlockDetect.cpp index 322084dc4..38a3c369e 100644 --- a/src/DeadlockDetect.cpp +++ b/src/DeadlockDetect.cpp @@ -112,18 +112,21 @@ void cDeadlockDetect::CheckWorldAge(const AString & a_WorldName, Int64 a_Age) ASSERT(!"Unknown world in cDeadlockDetect"); return; } - if (itr->second.m_Age == a_Age) + + cDeadlockDetect::sWorldAge & WorldAge = itr->second; + + if (WorldAge.m_Age == a_Age) { - itr->second.m_NumCyclesSame += 1; - if (itr->second.m_NumCyclesSame > (1000 * m_IntervalSec) / CYCLE_MILLISECONDS) + WorldAge.m_NumCyclesSame += 1; + if (WorldAge.m_NumCyclesSame > (1000 * m_IntervalSec) / CYCLE_MILLISECONDS) { DeadlockDetected(); } } else { - itr->second.m_Age = a_Age; - itr->second.m_NumCyclesSame = 0; + WorldAge.m_Age = a_Age; + WorldAge.m_NumCyclesSame = 0; } } |