summaryrefslogtreecommitdiffstats
path: root/src/DeadlockDetect.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-04-22 13:34:32 +0200
committerMattes D <github@xoft.cz>2014-04-22 13:34:32 +0200
commit6492aa000b322877aecda32573cc55b57abfc5ed (patch)
treef9f0f9211b42aa72729f8d6d444e4f48556e5fb9 /src/DeadlockDetect.cpp
parentAdded prefab hitboxes. (diff)
parentreverted the revert of the minecart collision detection fix. (diff)
downloadcuberite-6492aa000b322877aecda32573cc55b57abfc5ed.tar
cuberite-6492aa000b322877aecda32573cc55b57abfc5ed.tar.gz
cuberite-6492aa000b322877aecda32573cc55b57abfc5ed.tar.bz2
cuberite-6492aa000b322877aecda32573cc55b57abfc5ed.tar.lz
cuberite-6492aa000b322877aecda32573cc55b57abfc5ed.tar.xz
cuberite-6492aa000b322877aecda32573cc55b57abfc5ed.tar.zst
cuberite-6492aa000b322877aecda32573cc55b57abfc5ed.zip
Diffstat (limited to 'src/DeadlockDetect.cpp')
-rw-r--r--src/DeadlockDetect.cpp13
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;
}
}