parent
e9e7ca130d
commit
c54f9cede2
@ -32,8 +32,11 @@ void cBlockPistonHandler::OnDestroyed(cChunkInterface & a_ChunkInterface, cWorld
|
|||||||
{
|
{
|
||||||
Vector3i blockPos(a_BlockX, a_BlockY, a_BlockZ);
|
Vector3i blockPos(a_BlockX, a_BlockY, a_BlockZ);
|
||||||
|
|
||||||
// Get the extension of the piston
|
|
||||||
NIBBLETYPE OldMeta = a_ChunkInterface.GetBlockMeta(blockPos.x, blockPos.y, blockPos.z);
|
NIBBLETYPE OldMeta = a_ChunkInterface.GetBlockMeta(blockPos.x, blockPos.y, blockPos.z);
|
||||||
|
// If the piston is extended, destroy the extension as well
|
||||||
|
if (IsExtended(OldMeta))
|
||||||
|
{
|
||||||
|
// Get the position of the extension
|
||||||
blockPos += MetadataToOffset(OldMeta);
|
blockPos += MetadataToOffset(OldMeta);
|
||||||
|
|
||||||
if (a_ChunkInterface.GetBlock(blockPos) == E_BLOCK_PISTON_EXTENSION)
|
if (a_ChunkInterface.GetBlock(blockPos) == E_BLOCK_PISTON_EXTENSION)
|
||||||
@ -41,6 +44,7 @@ void cBlockPistonHandler::OnDestroyed(cChunkInterface & a_ChunkInterface, cWorld
|
|||||||
a_ChunkInterface.SetBlock(blockPos.x, blockPos.y, blockPos.z, E_BLOCK_AIR, 0);
|
a_ChunkInterface.SetBlock(blockPos.x, blockPos.y, blockPos.z, E_BLOCK_AIR, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user