From de306d9f798a91b44f73b33cb2709b6194afce21 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Mon, 19 Aug 2013 19:43:28 +0100 Subject: Fixed uninitialised thingummies --- source/Chunk.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source') diff --git a/source/Chunk.h b/source/Chunk.h index 6e8fe5cbf..d6a4061aa 100644 --- a/source/Chunk.h +++ b/source/Chunk.h @@ -330,7 +330,7 @@ private: Int64 m_Tick; sSetBlockQueueItem(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Int64 a_Tick) : - m_RelX(a_RelX), m_RelY(a_RelY), m_RelZ(a_RelZ) + m_RelX(a_RelX), m_RelY(a_RelY), m_RelZ(a_RelZ), m_BlockType(a_BlockType), m_BlockMeta(a_BlockMeta) { } } ; -- cgit v1.2.3 From c11e252e27605fd8d5ed4e9e3ba0cd0563a5ee50 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Mon, 19 Aug 2013 19:44:22 +0100 Subject: Fixed piston animations... ...for the third (and hopefully last) time. --- source/Piston.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'source') diff --git a/source/Piston.cpp b/source/Piston.cpp index d6ea01803..0af365b17 100644 --- a/source/Piston.cpp +++ b/source/Piston.cpp @@ -98,7 +98,7 @@ void cPiston::ExtendPiston(int pistx, int pisty, int pistz) { AddDir(pistx, pisty, pistz, pistonMeta, -1); m_World->GetBlockTypeMeta(pistx, pisty, pistz, currBlock, currBlockMeta); - m_World->SetBlock( oldx, oldy, oldz, currBlock, currBlockMeta); + m_World->QueueSetBlock( oldx, oldy, oldz, currBlock, currBlockMeta, 320); oldx = pistx; oldy = pisty; oldz = pistz; @@ -113,7 +113,7 @@ void cPiston::ExtendPiston(int pistx, int pisty, int pistz) m_World->BroadcastBlockAction(pistx, pisty, pistz, 0, pistonMeta, pistonBlock); m_World->BroadcastSoundEffect("tile.piston.out", pistx * 8, pisty * 8, pistz * 8, 0.5f, 0.7f); m_World->FastSetBlock( pistx, pisty, pistz, pistonBlock, pistonMeta | 0x8 ); - m_World->SetBlock(extx, exty, extz, E_BLOCK_PISTON_EXTENSION, pistonMeta | (IsSticky(pistonBlock) ? 8 : 0)); + m_World->QueueSetBlock(extx, exty, extz, E_BLOCK_PISTON_EXTENSION, pistonMeta | (IsSticky(pistonBlock) ? 8 : 0), 320); } @@ -133,7 +133,7 @@ void cPiston::RetractPiston( int pistx, int pisty, int pistz ) m_World->BroadcastBlockAction(pistx, pisty, pistz, 1, pistonMeta & ~(8), pistonBlock); m_World->BroadcastSoundEffect("tile.piston.in", pistx * 8, pisty * 8, pistz * 8, 0.5f, 0.7f); - m_World->SetBlock(pistx, pisty, pistz, pistonBlock, pistonMeta & ~(8)); + m_World->QueueSetBlock(pistx, pisty, pistz, pistonBlock, pistonMeta & ~(8), 320); // Check the extension: @@ -155,18 +155,18 @@ void cPiston::RetractPiston( int pistx, int pisty, int pistz ) if (CanPull(tempBlock, tempMeta)) { // Pull the block - m_World->SetBlock(pistx, pisty, pistz, tempBlock, tempMeta); - m_World->SetBlock(tempx, tempy, tempz, E_BLOCK_AIR, 0); + m_World->QueueSetBlock(pistx, pisty, pistz, tempBlock, tempMeta, 320); + m_World->QueueSetBlock(tempx, tempy, tempz, E_BLOCK_AIR, 0, 320); } else { // Retract without pulling - m_World->SetBlock(pistx, pisty, pistz, E_BLOCK_AIR, 0); + m_World->QueueSetBlock(pistx, pisty, pistz, E_BLOCK_AIR, 0, 320); } } else { - m_World->SetBlock(pistx, pisty, pistz, E_BLOCK_AIR, 0); + m_World->QueueSetBlock(pistx, pisty, pistz, E_BLOCK_AIR, 0, 320); } } -- cgit v1.2.3 From b51e9fa359799365067cbb8b02f6bcc6ef5fe6ca Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Mon, 19 Aug 2013 21:54:47 +0100 Subject: Added forgotten initialisation --- source/Chunk.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source') diff --git a/source/Chunk.h b/source/Chunk.h index d6a4061aa..c979b7928 100644 --- a/source/Chunk.h +++ b/source/Chunk.h @@ -330,7 +330,7 @@ private: Int64 m_Tick; sSetBlockQueueItem(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Int64 a_Tick) : - m_RelX(a_RelX), m_RelY(a_RelY), m_RelZ(a_RelZ), m_BlockType(a_BlockType), m_BlockMeta(a_BlockMeta) + m_RelX(a_RelX), m_RelY(a_RelY), m_RelZ(a_RelZ), m_BlockType(a_BlockType), m_BlockMeta(a_BlockMeta), m_Tick(a_Tick) { } } ; -- cgit v1.2.3 From d4f8f0f70e90340f319884d678f7add25adc54a3 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Mon, 19 Aug 2013 21:56:03 +0100 Subject: Additional piston corrections Reduced delay time of blockset Fixed invalid blockpush checking --- source/Piston.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'source') diff --git a/source/Piston.cpp b/source/Piston.cpp index 0af365b17..d1d2b96a4 100644 --- a/source/Piston.cpp +++ b/source/Piston.cpp @@ -39,16 +39,16 @@ int cPiston::FirstPassthroughBlock(int pistonX, int pistonY, int pistonZ, NIBBLE NIBBLETYPE currMeta; AddDir(pistonX, pistonY, pistonZ, pistonmeta, 1); m_World->GetBlockTypeMeta(pistonX, pistonY, pistonZ, currBlock, currMeta); - if (CanBreakPush(currBlock, currMeta)) - { - // This block breaks when pushed, extend up to here - return ret; - } if (!CanPush(currBlock, currMeta)) { // This block cannot be pushed at all, the piston can't extend return -1; } + if (CanBreakPush(currBlock, currMeta)) + { + // This block breaks when pushed, extend up to here + return ret; + } } // There is no space for the blocks to move, piston can't extend return -1; @@ -98,7 +98,7 @@ void cPiston::ExtendPiston(int pistx, int pisty, int pistz) { AddDir(pistx, pisty, pistz, pistonMeta, -1); m_World->GetBlockTypeMeta(pistx, pisty, pistz, currBlock, currBlockMeta); - m_World->QueueSetBlock( oldx, oldy, oldz, currBlock, currBlockMeta, 320); + m_World->QueueSetBlock( oldx, oldy, oldz, currBlock, currBlockMeta, 80); oldx = pistx; oldy = pisty; oldz = pistz; @@ -113,7 +113,7 @@ void cPiston::ExtendPiston(int pistx, int pisty, int pistz) m_World->BroadcastBlockAction(pistx, pisty, pistz, 0, pistonMeta, pistonBlock); m_World->BroadcastSoundEffect("tile.piston.out", pistx * 8, pisty * 8, pistz * 8, 0.5f, 0.7f); m_World->FastSetBlock( pistx, pisty, pistz, pistonBlock, pistonMeta | 0x8 ); - m_World->QueueSetBlock(extx, exty, extz, E_BLOCK_PISTON_EXTENSION, pistonMeta | (IsSticky(pistonBlock) ? 8 : 0), 320); + m_World->QueueSetBlock(extx, exty, extz, E_BLOCK_PISTON_EXTENSION, pistonMeta | (IsSticky(pistonBlock) ? 8 : 0), 80); } @@ -133,7 +133,7 @@ void cPiston::RetractPiston( int pistx, int pisty, int pistz ) m_World->BroadcastBlockAction(pistx, pisty, pistz, 1, pistonMeta & ~(8), pistonBlock); m_World->BroadcastSoundEffect("tile.piston.in", pistx * 8, pisty * 8, pistz * 8, 0.5f, 0.7f); - m_World->QueueSetBlock(pistx, pisty, pistz, pistonBlock, pistonMeta & ~(8), 320); + m_World->QueueSetBlock(pistx, pisty, pistz, pistonBlock, pistonMeta & ~(8), 80); // Check the extension: @@ -155,18 +155,18 @@ void cPiston::RetractPiston( int pistx, int pisty, int pistz ) if (CanPull(tempBlock, tempMeta)) { // Pull the block - m_World->QueueSetBlock(pistx, pisty, pistz, tempBlock, tempMeta, 320); - m_World->QueueSetBlock(tempx, tempy, tempz, E_BLOCK_AIR, 0, 320); + m_World->QueueSetBlock(pistx, pisty, pistz, tempBlock, tempMeta, 80); + m_World->QueueSetBlock(tempx, tempy, tempz, E_BLOCK_AIR, 0, 80); } else { // Retract without pulling - m_World->QueueSetBlock(pistx, pisty, pistz, E_BLOCK_AIR, 0, 320); + m_World->QueueSetBlock(pistx, pisty, pistz, E_BLOCK_AIR, 0, 80); } } else { - m_World->QueueSetBlock(pistx, pisty, pistz, E_BLOCK_AIR, 0, 320); + m_World->QueueSetBlock(pistx, pisty, pistz, E_BLOCK_AIR, 0, 80); } } -- cgit v1.2.3