Corrected IsBlockAttachable() in BlockVine.h
This commit is contained in:
parent
fec509935d
commit
e8e428a806
@ -23,10 +23,6 @@ public:
|
|||||||
BLOCKTYPE & a_BlockType, NIBBLETYPE & a_BlockMeta
|
BLOCKTYPE & a_BlockType, NIBBLETYPE & a_BlockMeta
|
||||||
) override
|
) override
|
||||||
{
|
{
|
||||||
UNUSED(a_Player);
|
|
||||||
UNUSED(a_CursorX);
|
|
||||||
UNUSED(a_CursorY);
|
|
||||||
UNUSED(a_CursorZ);
|
|
||||||
// TODO: Disallow placement where the vine doesn't attach to something properly
|
// TODO: Disallow placement where the vine doesn't attach to something properly
|
||||||
BLOCKTYPE BlockType = 0;
|
BLOCKTYPE BlockType = 0;
|
||||||
NIBBLETYPE BlockMeta;
|
NIBBLETYPE BlockMeta;
|
||||||
@ -80,7 +76,21 @@ public:
|
|||||||
/// Returns true if the specified block type is good for vines to attach to
|
/// Returns true if the specified block type is good for vines to attach to
|
||||||
static bool IsBlockAttachable(BLOCKTYPE a_BlockType)
|
static bool IsBlockAttachable(BLOCKTYPE a_BlockType)
|
||||||
{
|
{
|
||||||
return ((a_BlockType == E_BLOCK_LEAVES) || (a_BlockType == E_BLOCK_NEW_LEAVES) || cBlockInfo::IsSolid(a_BlockType));
|
switch (a_BlockType)
|
||||||
|
{
|
||||||
|
case E_BLOCK_GLASS:
|
||||||
|
case E_BLOCK_STAINED_GLASS:
|
||||||
|
case E_BLOCK_CHEST:
|
||||||
|
case E_BLOCK_TRAPPED_CHEST:
|
||||||
|
{
|
||||||
|
// You can't attach a vine to this solid blocks.
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
return cBlockInfo::IsSolid(a_BlockType);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user