summaryrefslogtreecommitdiffstats
path: root/src/World.cpp
diff options
context:
space:
mode:
authorHax52 <jay.bourgeois7@gmail.com>2015-06-23 04:00:15 +0200
committerhax52 <jay.bourgeois7@gmail.com>2015-06-24 20:52:56 +0200
commit9f1d1c058fa5fe415a264be710d774dc37e12f5e (patch)
tree45298832af28e55e24239e3821ca72730440ecd8 /src/World.cpp
parentMerge pull request #2274 from cuberite/ItemsRemovalFix (diff)
downloadcuberite-9f1d1c058fa5fe415a264be710d774dc37e12f5e.tar
cuberite-9f1d1c058fa5fe415a264be710d774dc37e12f5e.tar.gz
cuberite-9f1d1c058fa5fe415a264be710d774dc37e12f5e.tar.bz2
cuberite-9f1d1c058fa5fe415a264be710d774dc37e12f5e.tar.lz
cuberite-9f1d1c058fa5fe415a264be710d774dc37e12f5e.tar.xz
cuberite-9f1d1c058fa5fe415a264be710d774dc37e12f5e.tar.zst
cuberite-9f1d1c058fa5fe415a264be710d774dc37e12f5e.zip
Diffstat (limited to '')
-rw-r--r--src/World.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/World.cpp b/src/World.cpp
index cf2c35816..f4fd696ee 100644
--- a/src/World.cpp
+++ b/src/World.cpp
@@ -3051,7 +3051,11 @@ void cWorld::QueueTask(cTaskPtr a_Task)
}
-
+void cWorld::ScheduleTask(int a_DelayTicks, std::function<void (cWorld&)> a_Func)
+{
+ cTaskLambda task(a_Func);
+ ScheduleTask(a_DelayTicks, static_cast<cTaskPtr>(std::make_shared<cTaskLambda>(task)));
+}
void cWorld::ScheduleTask(int a_DelayTicks, cTaskPtr a_Task)
@@ -3554,8 +3558,10 @@ void cWorld::cTaskSendBlockToAllPlayers::Run(cWorld & a_World)
a_World.ForEachPlayer(PlayerCallback);
}
-
-
+void cWorld::cTaskLambda::Run(cWorld & a_World)
+{
+ m_func(a_World);
+}
////////////////////////////////////////////////////////////////////////////////