diff options
author | LogicParrot <LogicParrot@users.noreply.github.com> | 2016-02-19 09:58:35 +0100 |
---|---|---|
committer | LogicParrot <LogicParrot@users.noreply.github.com> | 2016-02-19 09:58:35 +0100 |
commit | a776337e5ecc4ba9fe54a46069f3423fbad56ec4 (patch) | |
tree | 637e5302c5c5affc5f3c52d4c195cba5607aac30 /src/Mobs/PassiveMonster.cpp | |
parent | Merge pull request #3020 from cuberite/ice_block (diff) | |
parent | Proper entity destruction in non-ticking chunks (diff) | |
download | cuberite-a776337e5ecc4ba9fe54a46069f3423fbad56ec4.tar cuberite-a776337e5ecc4ba9fe54a46069f3423fbad56ec4.tar.gz cuberite-a776337e5ecc4ba9fe54a46069f3423fbad56ec4.tar.bz2 cuberite-a776337e5ecc4ba9fe54a46069f3423fbad56ec4.tar.lz cuberite-a776337e5ecc4ba9fe54a46069f3423fbad56ec4.tar.xz cuberite-a776337e5ecc4ba9fe54a46069f3423fbad56ec4.tar.zst cuberite-a776337e5ecc4ba9fe54a46069f3423fbad56ec4.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Mobs/PassiveMonster.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/Mobs/PassiveMonster.cpp b/src/Mobs/PassiveMonster.cpp index 53288a54c..000f3d5a4 100644 --- a/src/Mobs/PassiveMonster.cpp +++ b/src/Mobs/PassiveMonster.cpp @@ -65,6 +65,18 @@ void cPassiveMonster::ResetLoveMode() +void cPassiveMonster::Destroyed() +{ + if (m_LovePartner != nullptr) + { + m_LovePartner->ResetLoveMode(); + } +} + + + + + void cPassiveMonster::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) { super::Tick(a_Dt, a_Chunk); @@ -73,10 +85,6 @@ void cPassiveMonster::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) { CheckEventLostPlayer(); } - if ((m_LovePartner != nullptr) && m_LovePartner->IsDestroyed()) - { - m_LovePartner = nullptr; - } // if we have a partner, mate if (m_LovePartner != nullptr) |