summaryrefslogtreecommitdiffstats
path: root/source/Piston.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2013-08-14 13:03:13 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2013-08-14 13:03:13 +0200
commit77468f87b75204ed55147761290bb3450ddb1436 (patch)
treee1ca5f65763b7835d682246a613419277e8f22d1 /source/Piston.cpp
parentAlpha sorted PistonBreakable list (diff)
parentPartially fixed tonibm19's mess. (diff)
downloadcuberite-77468f87b75204ed55147761290bb3450ddb1436.tar
cuberite-77468f87b75204ed55147761290bb3450ddb1436.tar.gz
cuberite-77468f87b75204ed55147761290bb3450ddb1436.tar.bz2
cuberite-77468f87b75204ed55147761290bb3450ddb1436.tar.lz
cuberite-77468f87b75204ed55147761290bb3450ddb1436.tar.xz
cuberite-77468f87b75204ed55147761290bb3450ddb1436.tar.zst
cuberite-77468f87b75204ed55147761290bb3450ddb1436.zip
Diffstat (limited to '')
-rw-r--r--source/Piston.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/source/Piston.cpp b/source/Piston.cpp
index d75cd4989..8729287de 100644
--- a/source/Piston.cpp
+++ b/source/Piston.cpp
@@ -21,11 +21,14 @@
*/
-//Athar from http://www.cplusplus.com/forum/unices/60161/ helped with the sleep code.
extern bool g_BlockPistonBreakable[];
+
+
+
+
#define AddDir( x, y, z, dir, amount ) \
switch (dir) \
{ \
@@ -132,6 +135,9 @@ void cPiston::ExtendPiston( int pistx, int pisty, int pistz )
/*
#ifdef _WIN32
+ // Sleeping here will play the piston animation on the client; however, it will block the entire server
+ // for the 100 ms, effectively dropping 2 game ticks per piston. This is very bad
+ // This needs to be handled using delayed scheduled tasks instead
Sleep(100);
#else
usleep(static_cast<useconds_t>(100)*1000);
@@ -184,6 +190,10 @@ void cPiston::RetractPiston( int pistx, int pisty, int pistz )
}
/*
#ifdef _WIN32
+ // TODO: This code needs replacing
+ // Sleeping here will play the piston animation on the client; however, it will block the entire server
+ // for the 100 ms, effectively dropping 2 game ticks per piston. This is very bad
+ // This needs to be handled using delayed scheduled tasks instead
Sleep(100);
#else
usleep(static_cast<useconds_t>(100)*1000);
@@ -197,6 +207,9 @@ void cPiston::RetractPiston( int pistx, int pisty, int pistz )
{
/*
#ifdef _WIN32
+ // Sleeping here will play the piston animation on the client; however, it will block the entire server
+ // for the 100 ms, effectively dropping 2 game ticks per piston. This is very bad
+ // This needs to be handled using delayed scheduled tasks instead
Sleep(100);
#else
usleep(static_cast<useconds_t>(100)*1000);