Fixed door placement.
This commit is contained in:
parent
1af6210466
commit
9e478c6f29
@ -117,7 +117,8 @@ public:
|
||||
static bool CanBeOn(BLOCKTYPE a_BlockType)
|
||||
{
|
||||
// Vanilla refuses to place doors on transparent blocks
|
||||
return !cBlockInfo::IsTransparent(a_BlockType);
|
||||
// We need to keep the door compatible with itself, otherwise the top half drops while the bottom half stays
|
||||
return !cBlockInfo::IsTransparent(a_BlockType) || IsDoorBlockType(a_BlockType);
|
||||
}
|
||||
|
||||
|
||||
|
@ -27,7 +27,7 @@ public:
|
||||
) override
|
||||
{
|
||||
// Vanilla only allows door placement while clicking on the top face of the block below the door:
|
||||
if (a_BlockFace != BLOCK_FACE_NONE)
|
||||
if (a_BlockFace != BLOCK_FACE_TOP)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@ -40,7 +40,7 @@ public:
|
||||
}
|
||||
|
||||
// The door needs a compatible block below it:
|
||||
if ((a_BlockY > 0) && cBlockDoorHandler::CanBeOn(a_World.GetBlock(a_BlockX, a_BlockY - 1, a_BlockZ)))
|
||||
if ((a_BlockY > 0) && !cBlockDoorHandler::CanBeOn(a_World.GetBlock(a_BlockX, a_BlockY - 1, a_BlockZ)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user