diff options
author | Tycho <work.tycho+git@gmail.com> | 2014-01-17 19:23:40 +0100 |
---|---|---|
committer | Tycho <work.tycho+git@gmail.com> | 2014-01-17 19:23:40 +0100 |
commit | 287144839e446001015b70a34146c6f321812eda (patch) | |
tree | 80bc68e3a129c3ebd892a5a50dbbdd60a5e488e3 | |
parent | Implemented xsofts suggestion for a saturating counter in the scheduler (diff) | |
download | cuberite-287144839e446001015b70a34146c6f321812eda.tar cuberite-287144839e446001015b70a34146c6f321812eda.tar.gz cuberite-287144839e446001015b70a34146c6f321812eda.tar.bz2 cuberite-287144839e446001015b70a34146c6f321812eda.tar.lz cuberite-287144839e446001015b70a34146c6f321812eda.tar.xz cuberite-287144839e446001015b70a34146c6f321812eda.tar.zst cuberite-287144839e446001015b70a34146c6f321812eda.zip |
Diffstat (limited to '')
-rw-r--r-- | src/World.cpp | 4 | ||||
-rw-r--r-- | src/World.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/World.cpp b/src/World.cpp index e4c03699f..f4b5f1ad8 100644 --- a/src/World.cpp +++ b/src/World.cpp @@ -885,7 +885,7 @@ void cWorld::TickScheduledTasks() } // for itr - m_Tasks[] // Increment TickID - m_TickID = (m_TickID+1) &0xFFFF; + m_TickID = (m_TickID+1) & 0x7FFFFFFF; } @@ -2622,7 +2622,7 @@ void cWorld::QueueTask(cTask * a_Task) void cWorld::ScheduleTask(cScheduledTask * a_Task) { - a_Task->Ticks = (a_Task->Ticks + m_TickID) & 0xFFFF; + a_Task->Ticks = (a_Task->Ticks + m_TickID) & 0x7FFFFFFF; cCSLock Lock(m_CSScheduledTasks); for(ScheduledTaskList::iterator itr = m_ScheduledTasks.begin(); itr != m_ScheduledTasks.end(); itr++) { diff --git a/src/World.h b/src/World.h index 2fd7319cf..1fe2740ad 100644 --- a/src/World.h +++ b/src/World.h @@ -773,7 +773,7 @@ private: ScheduledTaskList m_ScheduledTasks; /// Current Tick number for sceduled tasks - int m_TickID; + long m_TickID; /// Guards m_Clients cCriticalSection m_CSClients; |