diff options
author | Alexander Harkness <me@bearbin.net> | 2020-04-03 22:24:49 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-03 22:24:49 +0200 |
commit | ba048e2101d42af53f2ac7a9a3ed04c194918136 (patch) | |
tree | 169c0e1f5f0cd306feadc00fd82b3079babf3088 /src/Blocks/BlockBed.cpp | |
parent | Quick fix to make spawn eggs work (#4611) (diff) | |
download | cuberite-ba048e2101d42af53f2ac7a9a3ed04c194918136.tar cuberite-ba048e2101d42af53f2ac7a9a3ed04c194918136.tar.gz cuberite-ba048e2101d42af53f2ac7a9a3ed04c194918136.tar.bz2 cuberite-ba048e2101d42af53f2ac7a9a3ed04c194918136.tar.lz cuberite-ba048e2101d42af53f2ac7a9a3ed04c194918136.tar.xz cuberite-ba048e2101d42af53f2ac7a9a3ed04c194918136.tar.zst cuberite-ba048e2101d42af53f2ac7a9a3ed04c194918136.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Blocks/BlockBed.cpp | 16 |
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); } } } |