diff options
author | admin@omencraft.com <admin@omencraft.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2011-11-09 02:31:19 +0100 |
---|---|---|
committer | admin@omencraft.com <admin@omencraft.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2011-11-09 02:31:19 +0100 |
commit | 744c0187ba3413d29c008f8ff5177f54540bf65b (patch) | |
tree | f31055885dceea455f94b0e2d85c8d2fc2fc9edf /source/cPiston.cpp | |
parent | Broke something in the filters file, fixed now (diff) | |
download | cuberite-744c0187ba3413d29c008f8ff5177f54540bf65b.tar cuberite-744c0187ba3413d29c008f8ff5177f54540bf65b.tar.gz cuberite-744c0187ba3413d29c008f8ff5177f54540bf65b.tar.bz2 cuberite-744c0187ba3413d29c008f8ff5177f54540bf65b.tar.lz cuberite-744c0187ba3413d29c008f8ff5177f54540bf65b.tar.xz cuberite-744c0187ba3413d29c008f8ff5177f54540bf65b.tar.zst cuberite-744c0187ba3413d29c008f8ff5177f54540bf65b.zip |
Diffstat (limited to 'source/cPiston.cpp')
-rw-r--r-- | source/cPiston.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source/cPiston.cpp b/source/cPiston.cpp index 928d7c04b..1104122c8 100644 --- a/source/cPiston.cpp +++ b/source/cPiston.cpp @@ -16,6 +16,7 @@ extern bool g_BlockPistonBreakable[]; #define AddDir( x, y, z, dir, amount ) switch(dir) { case 0: (y)-=(amount); break; case 1: (y)+=(amount); break;\
case 2: (z)-=(amount); break; case 3: (z)+=(amount); break;\
case 4: (x)-=(amount); break; case 5: (x)+=(amount); break; }
+
#define FAST_FLOOR( x ) ( (x) < 0 ? ((int)x)-1 : ((int)x) )
cPiston::cPiston( cWorld* a_World )
@@ -77,6 +78,8 @@ void cPiston::ExtendPiston( int pistx, int pisty, int pistz ) { Action.m_PosZ = (int)pistz;
Action.m_Byte1 = 0;
Action.m_Byte2 = pistonMeta;
+
+
cChunk* Chunk = m_World->GetChunk( FAST_FLOOR(pistx/16), FAST_FLOOR(pisty/16), FAST_FLOOR(pistz/16) );
Chunk->Broadcast( Action );
m_World->FastSetBlock( pistx, pisty, pistz, pistonBlock, pistonMeta | 8 );
@@ -109,7 +112,7 @@ void cPiston::RetractPiston( int pistx, int pisty, int pistz ) { Action.m_PosY = (short)pisty;
Action.m_PosZ = (int)pistz;
Action.m_Byte1 = 1;
- Action.m_Byte1 = pistonMeta & ~(8);
+ Action.m_Byte2 = pistonMeta & ~(8);
cChunk* Chunk = m_World->GetChunk( FAST_FLOOR(pistx/16), FAST_FLOOR(pisty/16), FAST_FLOOR(pistz/16) );
Chunk->Broadcast( Action );
m_World->FastSetBlock( pistx, pisty, pistz, pistonBlock, pistonMeta & ~(8) );
|