summaryrefslogtreecommitdiffstats
path: root/src/World.cpp
diff options
context:
space:
mode:
authorworktycho <work.tycho@gmail.com>2015-06-25 16:46:33 +0200
committerworktycho <work.tycho@gmail.com>2015-06-25 16:46:33 +0200
commit7187c003422aae137b1000af04b9bc06c5c4e9d4 (patch)
tree5be1d79c3acddddb0c1c6622c401fa4537735599 /src/World.cpp
parentMerge pull request #2290 from bibo38/mousefix (diff)
parentButtons no longer click on when already on. Buttons now play sound when clicking off. (diff)
downloadcuberite-7187c003422aae137b1000af04b9bc06c5c4e9d4.tar
cuberite-7187c003422aae137b1000af04b9bc06c5c4e9d4.tar.gz
cuberite-7187c003422aae137b1000af04b9bc06c5c4e9d4.tar.bz2
cuberite-7187c003422aae137b1000af04b9bc06c5c4e9d4.tar.lz
cuberite-7187c003422aae137b1000af04b9bc06c5c4e9d4.tar.xz
cuberite-7187c003422aae137b1000af04b9bc06c5c4e9d4.tar.zst
cuberite-7187c003422aae137b1000af04b9bc06c5c4e9d4.zip
Diffstat (limited to 'src/World.cpp')
-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);
+}
////////////////////////////////////////////////////////////////////////////////