summaryrefslogtreecommitdiffstats
path: root/source/cPiston.cpp
diff options
context:
space:
mode:
authorfaketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-03-01 16:18:59 +0100
committerfaketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-03-01 16:18:59 +0100
commit867fc8ee0dbebd3c09a4f7cdcbd5fb4d56f194dc (patch)
treea2f8b4a22a9b721d94ffa595ef57a07d1339f482 /source/cPiston.cpp
parentFixed the authenticator bug (diff)
downloadcuberite-867fc8ee0dbebd3c09a4f7cdcbd5fb4d56f194dc.tar
cuberite-867fc8ee0dbebd3c09a4f7cdcbd5fb4d56f194dc.tar.gz
cuberite-867fc8ee0dbebd3c09a4f7cdcbd5fb4d56f194dc.tar.bz2
cuberite-867fc8ee0dbebd3c09a4f7cdcbd5fb4d56f194dc.tar.lz
cuberite-867fc8ee0dbebd3c09a4f7cdcbd5fb4d56f194dc.tar.xz
cuberite-867fc8ee0dbebd3c09a4f7cdcbd5fb4d56f194dc.tar.zst
cuberite-867fc8ee0dbebd3c09a4f7cdcbd5fb4d56f194dc.zip
Diffstat (limited to 'source/cPiston.cpp')
-rw-r--r--source/cPiston.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/source/cPiston.cpp b/source/cPiston.cpp
index 9c4363eeb..df9af6fb7 100644
--- a/source/cPiston.cpp
+++ b/source/cPiston.cpp
@@ -56,7 +56,8 @@ void cPiston::ExtendPiston( int pistx, int pisty, int pistz ) {
char pistonMeta = m_World->GetBlockMeta( pistx, pisty, pistz );
char isSticky = (char)(pistonBlock == E_BLOCK_STICKY_PISTON) * 8;
bool recalc = false;
- if (pistonMeta < 6) {// only extend if piston is not already extended
+ if ( (pistonMeta & 0x8) == 0x0 ) // only extend if piston is not already extended
+ {
unsigned short dist = FirstPassthroughBlock(pistx, pisty, pistz, pistonMeta);
if(dist>9000) return; // too many blocks
@@ -89,7 +90,7 @@ void cPiston::ExtendPiston( int pistx, int pisty, int pistz ) {
Action.m_Byte2 = pistonMeta;
m_World->BroadcastToChunkOfBlock(pistx, pisty, pistz, &Action);
- m_World->FastSetBlock( pistx, pisty, pistz, pistonBlock, pistonMeta | 8 );
+ m_World->FastSetBlock( pistx, pisty, pistz, pistonBlock, pistonMeta | 0x8 );
int extx = pistx;
int exty = pisty;