Fixed a door bug and reduced code
Doors wouldn't get powered by repeaters, and some blocks, like glass, were viable middle blocks when they shouldn't have been.
This commit is contained in:
parent
b068b73ad9
commit
6b25ef4fa3
@ -158,25 +158,7 @@ private:
|
|||||||
|
|
||||||
/* ====== Misc Functions ====== */
|
/* ====== Misc Functions ====== */
|
||||||
/** Returns if a block is viable to be the MiddleBlock of a SetLinkedPowered operation */
|
/** Returns if a block is viable to be the MiddleBlock of a SetLinkedPowered operation */
|
||||||
inline static bool IsViableMiddleBlock(BLOCKTYPE Block)
|
inline static bool IsViableMiddleBlock(BLOCKTYPE Block) { return g_BlockFullyOccupiesVoxel[Block]; }
|
||||||
{
|
|
||||||
if (!g_BlockIsSolid[Block]) { return false; }
|
|
||||||
|
|
||||||
switch (Block)
|
|
||||||
{
|
|
||||||
// Add SOLID but not viable middle blocks here
|
|
||||||
case E_BLOCK_PISTON:
|
|
||||||
case E_BLOCK_PISTON_EXTENSION:
|
|
||||||
case E_BLOCK_STICKY_PISTON:
|
|
||||||
case E_BLOCK_REDSTONE_REPEATER_ON:
|
|
||||||
case E_BLOCK_REDSTONE_REPEATER_OFF:
|
|
||||||
case E_BLOCK_DAYLIGHT_SENSOR:
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
default: return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Returns if a block is a mechanism (something that accepts power and does something) */
|
/** Returns if a block is a mechanism (something that accepts power and does something) */
|
||||||
inline static bool IsMechanism(BLOCKTYPE Block)
|
inline static bool IsMechanism(BLOCKTYPE Block)
|
||||||
|
Loading…
Reference in New Issue
Block a user