summaryrefslogtreecommitdiffstats
path: root/src/World.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2015-03-20 16:11:50 +0100
committerMattes D <github@xoft.cz>2015-03-20 16:11:50 +0100
commit8a43da07233fd8ab59dca14b8c14668f0651624b (patch)
tree79d0fe2868b9abe1690a813a5930e996e61db15f /src/World.cpp
parentMerge pull request #1821 from bibo38/bugfix1765 (diff)
parentAdded cPluginLua::cResettable interface, used for scheduled tasks. (diff)
downloadcuberite-8a43da07233fd8ab59dca14b8c14668f0651624b.tar
cuberite-8a43da07233fd8ab59dca14b8c14668f0651624b.tar.gz
cuberite-8a43da07233fd8ab59dca14b8c14668f0651624b.tar.bz2
cuberite-8a43da07233fd8ab59dca14b8c14668f0651624b.tar.lz
cuberite-8a43da07233fd8ab59dca14b8c14668f0651624b.tar.xz
cuberite-8a43da07233fd8ab59dca14b8c14668f0651624b.tar.zst
cuberite-8a43da07233fd8ab59dca14b8c14668f0651624b.zip
Diffstat (limited to 'src/World.cpp')
-rw-r--r--src/World.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/World.cpp b/src/World.cpp
index 292ff9b94..03f09c028 100644
--- a/src/World.cpp
+++ b/src/World.cpp
@@ -3167,14 +3167,14 @@ void cWorld::SaveAllChunks(void)
void cWorld::QueueSaveAllChunks(void)
{
- QueueTask(make_unique<cWorld::cTaskSaveAllChunks>());
+ QueueTask(std::make_shared<cWorld::cTaskSaveAllChunks>());
}
-void cWorld::QueueTask(std::unique_ptr<cTask> a_Task)
+void cWorld::QueueTask(cTaskPtr a_Task)
{
cCSLock Lock(m_CSTasks);
m_Tasks.push_back(std::move(a_Task));
@@ -3184,7 +3184,7 @@ void cWorld::QueueTask(std::unique_ptr<cTask> a_Task)
-void cWorld::ScheduleTask(int a_DelayTicks, cTask * a_Task)
+void cWorld::ScheduleTask(int a_DelayTicks, cTaskPtr a_Task)
{
Int64 TargetTick = a_DelayTicks + std::chrono::duration_cast<cTickTimeLong>(m_WorldAge).count();
@@ -3194,11 +3194,11 @@ void cWorld::ScheduleTask(int a_DelayTicks, cTask * a_Task)
{
if ((*itr)->m_TargetTick >= TargetTick)
{
- m_ScheduledTasks.insert(itr, make_unique<cScheduledTask>(TargetTick, a_Task));
+ m_ScheduledTasks.insert(itr, cScheduledTaskPtr(new cScheduledTask(TargetTick, a_Task)));
return;
}
}
- m_ScheduledTasks.push_back(make_unique<cScheduledTask>(TargetTick, a_Task));
+ m_ScheduledTasks.push_back(cScheduledTaskPtr(new cScheduledTask(TargetTick, a_Task)));
}