summaryrefslogtreecommitdiffstats
path: root/src/World.cpp
diff options
context:
space:
mode:
authorTycho <work.tycho+git@gmail.com>2014-01-18 15:15:33 +0100
committerTycho <work.tycho+git@gmail.com>2014-01-18 15:15:33 +0100
commit160a27ccedf0aa8590bcf03abc9154eb1ee7b72d (patch)
tree26ed6c78ff7c3fa9985d88fad515536c7b6a8e4f /src/World.cpp
parentIncreased tick count to long (diff)
downloadcuberite-160a27ccedf0aa8590bcf03abc9154eb1ee7b72d.tar
cuberite-160a27ccedf0aa8590bcf03abc9154eb1ee7b72d.tar.gz
cuberite-160a27ccedf0aa8590bcf03abc9154eb1ee7b72d.tar.bz2
cuberite-160a27ccedf0aa8590bcf03abc9154eb1ee7b72d.tar.lz
cuberite-160a27ccedf0aa8590bcf03abc9154eb1ee7b72d.tar.xz
cuberite-160a27ccedf0aa8590bcf03abc9154eb1ee7b72d.tar.zst
cuberite-160a27ccedf0aa8590bcf03abc9154eb1ee7b72d.zip
Diffstat (limited to 'src/World.cpp')
-rw-r--r--src/World.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/World.cpp b/src/World.cpp
index f4b5f1ad8..a466acb84 100644
--- a/src/World.cpp
+++ b/src/World.cpp
@@ -870,7 +870,7 @@ void cWorld::TickScheduledTasks()
{
cCSLock Lock(m_CSScheduledTasks);
ScheduledTaskList::iterator itr = m_ScheduledTasks.begin();
- while (itr != m_ScheduledTasks.end() && (*itr)->Ticks > 0)
+ while (itr != m_ScheduledTasks.end() && (*itr)->Ticks < m_WorldAge)
{
Tasks.push_back(m_ScheduledTasks.front());
m_ScheduledTasks.pop_front();
@@ -883,9 +883,6 @@ void cWorld::TickScheduledTasks()
(*itr)->Run(*this);
delete *itr;
} // for itr - m_Tasks[]
-
- // Increment TickID
- m_TickID = (m_TickID+1) & 0x7FFFFFFF;
}
@@ -2622,11 +2619,11 @@ void cWorld::QueueTask(cTask * a_Task)
void cWorld::ScheduleTask(cScheduledTask * a_Task)
{
- a_Task->Ticks = (a_Task->Ticks + m_TickID) & 0x7FFFFFFF;
+ a_Task->Ticks = a_Task->Ticks + m_WorldAge;
cCSLock Lock(m_CSScheduledTasks);
for(ScheduledTaskList::iterator itr = m_ScheduledTasks.begin(); itr != m_ScheduledTasks.end(); itr++)
{
- if((*itr)->Ticks >= a_Task->Ticks && (a_Task->Ticks > m_TickID || (*itr)->Ticks < m_TickID))
+ if((*itr)->Ticks >= a_Task->Ticks)
{
m_ScheduledTasks.insert(itr, a_Task);
return;