diff options
Diffstat (limited to 'src/BlockEntities/BrewingstandEntity.cpp')
-rw-r--r-- | src/BlockEntities/BrewingstandEntity.cpp | 44 |
1 files changed, 14 insertions, 30 deletions
diff --git a/src/BlockEntities/BrewingstandEntity.cpp b/src/BlockEntities/BrewingstandEntity.cpp index 9c43f257f..44a077bc0 100644 --- a/src/BlockEntities/BrewingstandEntity.cpp +++ b/src/BlockEntities/BrewingstandEntity.cpp @@ -13,7 +13,6 @@ cBrewingstandEntity::cBrewingstandEntity(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos, cWorld * a_World): Super(a_BlockType, a_BlockMeta, a_Pos, ContentsWidth, ContentsHeight, a_World), - m_IsDestroyed(false), m_IsBrewing(false), m_TimeBrewed(0), m_RemainingFuel(0) @@ -25,30 +24,6 @@ cBrewingstandEntity::cBrewingstandEntity(BLOCKTYPE a_BlockType, NIBBLETYPE a_Blo -cBrewingstandEntity::~cBrewingstandEntity() -{ - // Tell window its owner is destroyed - cWindow * Window = GetWindow(); - if (Window != nullptr) - { - Window->OwnerDestroyed(); - } -} - - - - - -void cBrewingstandEntity::Destroy() -{ - m_IsDestroyed = true; - Super::Destroy(); -} - - - - - void cBrewingstandEntity::CopyFrom(const cBlockEntity & a_Src) { Super::CopyFrom(a_Src); @@ -70,6 +45,20 @@ void cBrewingstandEntity::CopyFrom(const cBlockEntity & a_Src) +void cBrewingstandEntity::OnRemoveFromWorld() +{ + const auto Window = GetWindow(); + if (Window != nullptr) + { + // Tell window its owner is destroyed: + Window->OwnerDestroyed(); + } +} + + + + + void cBrewingstandEntity::SendTo(cClientHandle & a_Client) { // Nothing needs to be sent @@ -206,11 +195,6 @@ void cBrewingstandEntity::OnSlotChanged(cItemGrid * a_ItemGrid, int a_SlotNum) { Super::OnSlotChanged(a_ItemGrid, a_SlotNum); - if (m_IsDestroyed) - { - return; - } - ASSERT(a_ItemGrid == &m_Contents); // Check for fuel |