diff options
Diffstat (limited to 'src/World.cpp')
-rw-r--r-- | src/World.cpp | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/World.cpp b/src/World.cpp index 7c56d2efb..6520702c7 100644 --- a/src/World.cpp +++ b/src/World.cpp @@ -871,16 +871,11 @@ void cWorld::TickScheduledTasks() // Make a copy of the tasks to avoid deadlocks on accessing m_Tasks { cCSLock Lock(m_CSScheduledTasks); - ScheduledTaskList::iterator itr = m_ScheduledTasks.begin(); - while (itr != m_ScheduledTasks.end() && (*itr)->Ticks > 0) + while (!m_ScheduledTasks.empty() && m_ScheduledTasks.front()->Ticks < m_WorldAge) { Tasks.push_back(m_ScheduledTasks.front()); m_ScheduledTasks.pop_front(); } - for(;itr != m_ScheduledTasks.end(); itr++) - { - (*itr)->Ticks--; - } } // Execute and delete each task: @@ -2634,6 +2629,7 @@ void cWorld::QueueTask(cTask * a_Task) void cWorld::ScheduleTask(cScheduledTask * a_Task) { + a_Task->Ticks = a_Task->Ticks + m_WorldAge; cCSLock Lock(m_CSScheduledTasks); for(ScheduledTaskList::iterator itr = m_ScheduledTasks.begin(); itr != m_ScheduledTasks.end(); itr++) { @@ -2775,9 +2771,6 @@ int cWorld::SpawnMob(double a_PosX, double a_PosY, double a_PosZ, cMonster::eTyp { Monster->SetPosition(a_PosX, a_PosY, a_PosZ); } - - // Because it's logical that ALL mob spawns need spawn effects, not just spawners - BroadcastSoundParticleEffect(2004, (int)a_PosX, (int)a_PosY, (int)a_PosZ, 0); return SpawnMobFinalize(Monster); } |