1
0

Okay, changed to xoft's partial fix

This commit is contained in:
Tiger Wang 2013-08-14 12:08:36 +01:00
parent 77468f87b7
commit ad57f1966c

View File

@ -1,4 +1,3 @@
#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules #include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules
#include "Piston.h" #include "Piston.h"
@ -12,13 +11,6 @@
#include "Server.h" #include "Server.h"
#include "Blocks/BlockHandler.h" #include "Blocks/BlockHandler.h"
/*
#ifdef _WIN32
#include <windows.h>
#else
#include <unistd.h>
#endif
*/
@ -133,16 +125,11 @@ void cPiston::ExtendPiston( int pistx, int pisty, int pistz )
AddDir(extx, exty, extz, pistonMeta & 7, 1) AddDir(extx, exty, extz, pistonMeta & 7, 1)
/* // TODO: This code needs replacing
#ifdef _WIN32
// Sleeping here will play the piston animation on the client; however, it will block the entire server // 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 // 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 // This needs to be handled using delayed scheduled tasks instead
Sleep(100); cSleep::MilliSleep(100);
#else
usleep(static_cast<useconds_t>(100)*1000);
#endif
*/
m_World->SetBlock(extx, exty, extz, E_BLOCK_PISTON_EXTENSION, isSticky + pistonMeta & 7); m_World->SetBlock(extx, exty, extz, E_BLOCK_PISTON_EXTENSION, isSticky + pistonMeta & 7);
} }
@ -188,33 +175,23 @@ void cPiston::RetractPiston( int pistx, int pisty, int pistz )
// These cannot be moved by the sticky piston, bail out // These cannot be moved by the sticky piston, bail out
return; return;
} }
/*
#ifdef _WIN32
// TODO: This code needs replacing // TODO: This code needs replacing
// Sleeping here will play the piston animation on the client; however, it will block the entire server // 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 // 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 // This needs to be handled using delayed scheduled tasks instead
Sleep(100); cSleep::MilliSleep(100);
#else
usleep(static_cast<useconds_t>(100)*1000);
#endif
*/
m_World->SetBlock(pistx, pisty, pistz, tempblock, tempmeta); m_World->SetBlock(pistx, pisty, pistz, tempblock, tempmeta);
m_World->SetBlock(tempx, tempy, tempz, E_BLOCK_AIR, 0); m_World->SetBlock(tempx, tempy, tempz, E_BLOCK_AIR, 0);
} }
else else
{ {
/* // TODO: This code needs replacing
#ifdef _WIN32
// Sleeping here will play the piston animation on the client; however, it will block the entire server // 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 // 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 // This needs to be handled using delayed scheduled tasks instead
Sleep(100); cSleep::MilliSleep(100);
#else
usleep(static_cast<useconds_t>(100)*1000);
#endif
*/
m_World->SetBlock(pistx, pisty, pistz, E_BLOCK_AIR, 0); m_World->SetBlock(pistx, pisty, pistz, E_BLOCK_AIR, 0);
} }