diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2013-08-14 13:03:13 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2013-08-14 13:03:13 +0200 |
commit | 77468f87b75204ed55147761290bb3450ddb1436 (patch) | |
tree | e1ca5f65763b7835d682246a613419277e8f22d1 /source/Piston.cpp | |
parent | Alpha sorted PistonBreakable list (diff) | |
parent | Partially fixed tonibm19's mess. (diff) | |
download | cuberite-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 'source/Piston.cpp')
-rw-r--r-- | source/Piston.cpp | 15 |
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); |