diff --git a/source/world/item/DoorItem.cpp b/source/world/item/DoorItem.cpp index 91055959..739389c1 100644 --- a/source/world/item/DoorItem.cpp +++ b/source/world/item/DoorItem.cpp @@ -64,8 +64,10 @@ bool DoorItem::useOn(ItemInstance* inst, Player* player, Level* level, int x, in faceDir = 4 + ((faceDir - 1) & 3); // congratulations! You can now have a door. + level->field_30 = true; level->setTile(x, y + 1, z, pTile->m_ID); level->setData(x, y + 1, z, faceDir); + level->field_30 = false; level->setTile(x, y + 2, z, pTile->m_ID); level->setData(x, y + 2, z, faceDir + 8); inst->m_amount--; diff --git a/source/world/tile/DoorTile.cpp b/source/world/tile/DoorTile.cpp index a14b7eaa..3a7f5dfb 100644 --- a/source/world/tile/DoorTile.cpp +++ b/source/world/tile/DoorTile.cpp @@ -240,6 +240,11 @@ void DoorTile::neighborChanged(Level* level, int x, int y, int z, int newTile) if (level->hasNeighborSignal(x, y, z) || level->hasNeighborSignal(x, y + 1, z)) bOpen = true; + // NOTE: If you're wondering why placing redstone next to a door in the formation + // where two doors are side by side, facing each other (handle in the middle), opens + // the right door, that's because there's only four bits in the state, and the bits + // are all used (bit 3 is "top", bit 2 is "open", bits 1 and 0 are direction) + // Oh well... setOpen(level, x, y, z, bOpen); } } diff --git a/source/world/tile/PressurePlateTile.cpp b/source/world/tile/PressurePlateTile.cpp index 39eb82a6..70608b3e 100644 --- a/source/world/tile/PressurePlateTile.cpp +++ b/source/world/tile/PressurePlateTile.cpp @@ -60,16 +60,15 @@ void PressurePlateTile::updateShape(LevelSource* level, int x, int y, int z) setShape(0.0625f, 0.0f, 0.0625f, 0.9375f, 0.0625f, 0.9375f); } -void PressurePlateTile::destroy(Level* level, int x, int y, int z, int pdir) +void PressurePlateTile::destroy(Level* level, int x, int y, int z, int data) { - int data = level->getData(x, y, z); if (data > 0) { level->updateNeighborsAt(x, y, z, m_ID); level->updateNeighborsAt(x, y - 1, z, m_ID); } - Tile::destroy(level, x, y, z, pdir); + Tile::destroy(level, x, y, z, data); } int PressurePlateTile::getSignal(LevelSource* level, int x, int y, int z, int dir)