summaryrefslogtreecommitdiffstats
path: root/src/Blocks/BlockBed.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Blocks/BlockBed.cpp')
-rw-r--r--src/Blocks/BlockBed.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/Blocks/BlockBed.cpp b/src/Blocks/BlockBed.cpp
index e6193682a..8b349ef5e 100644
--- a/src/Blocks/BlockBed.cpp
+++ b/src/Blocks/BlockBed.cpp
@@ -21,27 +21,27 @@ void cBlockBedHandler::OnBroken(cChunkInterface & a_ChunkInterface, cWorldInterf
if ((a_OldBlockMeta & 0x08) != 0)
{
// Was pillow
- if (a_ChunkInterface.GetBlock(a_BlockPos - Direction) == E_BLOCK_BED)
+ Vector3i FootPos(a_BlockPos - Direction);
+ if (a_ChunkInterface.GetBlock(FootPos) == E_BLOCK_BED)
{
// First replace the bed with air
- a_ChunkInterface.FastSetBlock(a_BlockPos - Direction, E_BLOCK_AIR, 0);
+ a_ChunkInterface.FastSetBlock(FootPos, E_BLOCK_AIR, 0);
// Then destroy the bed entity
- Vector3i PillowPos(a_BlockPos - Direction);
- a_ChunkInterface.SetBlock(PillowPos, E_BLOCK_AIR, 0);
+ a_ChunkInterface.SetBlock(FootPos, E_BLOCK_AIR, 0);
}
}
else
{
// Was foot end
- if (a_ChunkInterface.GetBlock(a_BlockPos + Direction) == E_BLOCK_BED)
+ Vector3i PillowPos(a_BlockPos + Direction);
+ if (a_ChunkInterface.GetBlock(PillowPos) == E_BLOCK_BED)
{
// First replace the bed with air
- a_ChunkInterface.FastSetBlock(a_BlockPos + Direction, E_BLOCK_AIR, 0);
+ a_ChunkInterface.FastSetBlock(PillowPos, E_BLOCK_AIR, 0);
// Then destroy the bed entity
- Vector3i FootPos(a_BlockPos + Direction);
- a_ChunkInterface.SetBlock(FootPos, E_BLOCK_AIR, 0);
+ a_ChunkInterface.SetBlock(PillowPos, E_BLOCK_AIR, 0);
}
}
}