summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2013-08-13 18:44:01 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2013-08-13 18:44:01 +0200
commit27b400adf8457d2bed2b492ef01f9e6f68463a9d (patch)
treef049869bc254c1cfb486d6551f50e0dada7a6946 /source
parentAttempt three (diff)
downloadcuberite-27b400adf8457d2bed2b492ef01f9e6f68463a9d.tar
cuberite-27b400adf8457d2bed2b492ef01f9e6f68463a9d.tar.gz
cuberite-27b400adf8457d2bed2b492ef01f9e6f68463a9d.tar.bz2
cuberite-27b400adf8457d2bed2b492ef01f9e6f68463a9d.tar.lz
cuberite-27b400adf8457d2bed2b492ef01f9e6f68463a9d.tar.xz
cuberite-27b400adf8457d2bed2b492ef01f9e6f68463a9d.tar.zst
cuberite-27b400adf8457d2bed2b492ef01f9e6f68463a9d.zip
Diffstat (limited to 'source')
-rw-r--r--source/Piston.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/source/Piston.cpp b/source/Piston.cpp
index 0d436924c..0ebebfc9b 100644
--- a/source/Piston.cpp
+++ b/source/Piston.cpp
@@ -19,6 +19,8 @@
#endif
+//Athar from http://www.cplusplus.com/forum/unices/60161/ helped with the sleep code.
+
extern bool g_BlockPistonBreakable[];
@@ -129,7 +131,7 @@ void cPiston::ExtendPiston( int pistx, int pisty, int pistz )
#ifdef __WIN32__
Sleep(100);
#else
- usleep(static_cast<useconds_t>(100)*1000); //or use nanosleep on platforms where it's needed
+ usleep(static_cast<useconds_t>(100)*1000);
#endif
m_World->SetBlock(extx, exty, extz, E_BLOCK_PISTON_EXTENSION, isSticky + pistonMeta & 7);
@@ -179,7 +181,7 @@ void cPiston::RetractPiston( int pistx, int pisty, int pistz )
#ifdef __WIN32__
Sleep(100);
#else
- usleep(static_cast<useconds_t>(100)*1000); //or use nanosleep on platforms where it's needed
+ usleep(static_cast<useconds_t>(100)*1000);
#endif
m_World->SetBlock(pistx, pisty, pistz, tempblock, tempmeta);
@@ -190,7 +192,7 @@ void cPiston::RetractPiston( int pistx, int pisty, int pistz )
#ifdef __WIN32__
Sleep(100);
#else
- usleep(static_cast<useconds_t>(100)*1000); //or use nanosleep on platforms where it's needed
+ usleep(static_cast<useconds_t>(100)*1000);
#endif
m_World->SetBlock(pistx, pisty, pistz, E_BLOCK_AIR, 0);