summaryrefslogtreecommitdiffstats
path: root/src/BlockEntities/ChestEntity.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/BlockEntities/ChestEntity.cpp')
-rw-r--r--src/BlockEntities/ChestEntity.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/BlockEntities/ChestEntity.cpp b/src/BlockEntities/ChestEntity.cpp
index cb9cc89bf..21e1f6ba2 100644
--- a/src/BlockEntities/ChestEntity.cpp
+++ b/src/BlockEntities/ChestEntity.cpp
@@ -11,8 +11,9 @@
-cChestEntity::cChestEntity(int a_BlockX, int a_BlockY, int a_BlockZ, cWorld * a_World) :
- super(E_BLOCK_CHEST, a_BlockX, a_BlockY, a_BlockZ, ContentsWidth, ContentsHeight, a_World)
+cChestEntity::cChestEntity(int a_BlockX, int a_BlockY, int a_BlockZ, cWorld * a_World, BLOCKTYPE a_Type) :
+ super(a_Type, a_BlockX, a_BlockY, a_BlockZ, ContentsWidth, ContentsHeight, a_World),
+ m_NumActivePlayers(0)
{
cBlockEntityWindowOwner::SetBlockEntity(this);
}
@@ -113,7 +114,7 @@ void cChestEntity::UsedBy(cPlayer * a_Player)
// The few false positives aren't much to worry about
int ChunkX, ChunkZ;
cChunkDef::BlockToChunk(m_PosX, m_PosZ, ChunkX, ChunkZ);
- m_World->MarkChunkDirty(ChunkX, ChunkZ);
+ m_World->MarkChunkDirty(ChunkX, ChunkZ, true);
}
@@ -168,15 +169,15 @@ void cChestEntity::OpenNewWindow(void)
if (
m_World->DoWithChestAt(m_PosX - 1, m_PosY, m_PosZ, OpenDbl) ||
m_World->DoWithChestAt(m_PosX + 1, m_PosY, m_PosZ, OpenDbl) ||
- m_World->DoWithChestAt(m_PosX , m_PosY, m_PosZ - 1, OpenDbl) ||
- m_World->DoWithChestAt(m_PosX , m_PosY, m_PosZ + 1, OpenDbl)
+ m_World->DoWithChestAt(m_PosX, m_PosY, m_PosZ - 1, OpenDbl) ||
+ m_World->DoWithChestAt(m_PosX, m_PosY, m_PosZ + 1, OpenDbl)
)
{
// The double-chest window has been opened in the callback
return;
}
- // There is no chest neighbor, open a single-chest window:
+ // There is no chest neighbor, open a single-chest window:
OpenWindow(new cChestWindow(this));
}