Skip to content

Commit

Permalink
Corrected IsBlockAttachable() in BlockVine.h
Browse files Browse the repository at this point in the history
  • Loading branch information
Howaner committed Oct 7, 2014
1 parent fec5099 commit e8e428a
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions src/Blocks/BlockVine.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ class cBlockVineHandler :
BLOCKTYPE & a_BlockType, NIBBLETYPE & a_BlockMeta
) 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
BLOCKTYPE BlockType = 0;
NIBBLETYPE BlockMeta;
Expand Down Expand Up @@ -80,7 +76,21 @@ class cBlockVineHandler :
/// Returns true if the specified block type is good for vines to attach to
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);
}
}
}


Expand Down

0 comments on commit e8e428a

Please sign in to comment.