1
0
This commit is contained in:
Tiger Wang 2013-08-13 16:34:26 +01:00
parent 0ac24a98e4
commit 9ec248eaa0

View File

@ -122,6 +122,14 @@ void cPiston::ExtendPiston( int pistx, int pisty, int pistz )
AddDir(extx, exty, extz, pistonMeta & 7, 1)
#ifdef _WIN32 // Pause for 0.1 seconds to allow client animation to run
#include <windows.h>
Sleep(100);
#else
#include <unistd.h>
usleep(100 * 1000); // takes microseconds
#endif
m_World->SetBlock(extx, exty, extz, E_BLOCK_PISTON_EXTENSION, isSticky + pistonMeta & 7);
}
@ -166,11 +174,27 @@ void cPiston::RetractPiston( int pistx, int pisty, int pistz )
// These cannot be moved by the sticky piston, bail out
return;
}
#ifdef _WIN32
#include <windows.h>
Sleep(100);
#else
#include <unistd.h>
usleep(100 * 1000); // takes microseconds
#endif
m_World->SetBlock(pistx, pisty, pistz, tempblock, tempmeta);
m_World->SetBlock(tempx, tempy, tempz, E_BLOCK_AIR, 0);
}
else
{
#ifdef _WIN32
#include <windows.h>
Sleep(100);
#else
#include <unistd.h>
usleep(100 * 1000); // takes microseconds
#endif
m_World->SetBlock(pistx, pisty, pistz, E_BLOCK_AIR, 0);
}
}