diff options
author | Tiger Wang <ziwei.tiger@outlook.com> | 2021-01-02 14:50:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-02 14:50:34 +0100 |
commit | 16aeb84cd35996a6b41f10cbc48a677eeccc911c (patch) | |
tree | ae877926559d59a534bbf3c22651e6df7ffe8d71 /src/BlockEntities/BrewingstandEntity.cpp | |
parent | Fix version typo in CMakeLists.txt (#5098) (diff) | |
download | cuberite-16aeb84cd35996a6b41f10cbc48a677eeccc911c.tar cuberite-16aeb84cd35996a6b41f10cbc48a677eeccc911c.tar.gz cuberite-16aeb84cd35996a6b41f10cbc48a677eeccc911c.tar.bz2 cuberite-16aeb84cd35996a6b41f10cbc48a677eeccc911c.tar.lz cuberite-16aeb84cd35996a6b41f10cbc48a677eeccc911c.tar.xz cuberite-16aeb84cd35996a6b41f10cbc48a677eeccc911c.tar.zst cuberite-16aeb84cd35996a6b41f10cbc48a677eeccc911c.zip |
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 |