diff options
author | LogicParrot <LogicParrot@users.noreply.github.com> | 2016-04-06 11:13:14 +0200 |
---|---|---|
committer | LogicParrot <LogicParrot@users.noreply.github.com> | 2016-04-06 11:13:14 +0200 |
commit | dc15d274b50a4a3743245b1e322c5a7298c7c8ed (patch) | |
tree | 0066ddc00f73bf3e84b209a58ac445dce4611e2c /src/World.cpp | |
parent | Merge pull request #3102 from LogicParrot/burn (diff) | |
parent | Move mob tick code to cChunk (diff) | |
download | cuberite-dc15d274b50a4a3743245b1e322c5a7298c7c8ed.tar cuberite-dc15d274b50a4a3743245b1e322c5a7298c7c8ed.tar.gz cuberite-dc15d274b50a4a3743245b1e322c5a7298c7c8ed.tar.bz2 cuberite-dc15d274b50a4a3743245b1e322c5a7298c7c8ed.tar.lz cuberite-dc15d274b50a4a3743245b1e322c5a7298c7c8ed.tar.xz cuberite-dc15d274b50a4a3743245b1e322c5a7298c7c8ed.tar.zst cuberite-dc15d274b50a4a3743245b1e322c5a7298c7c8ed.zip |
Diffstat (limited to 'src/World.cpp')
-rw-r--r-- | src/World.cpp | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/src/World.cpp b/src/World.cpp index d8b77647a..dcf02f02a 100644 --- a/src/World.cpp +++ b/src/World.cpp @@ -1131,52 +1131,6 @@ void cWorld::TickMobs(std::chrono::milliseconds a_Dt) } } // for i - AllFamilies[] } // if (Spawning enabled) - - class cCallback : public cEntityCallback - { - virtual bool Item(cEntity * a_Entity) override - { - if (!a_Entity->IsMob()) - { - return false; - } - if (!a_Entity->IsTicking()) - { - return false; - } - - auto Monster = static_cast<cMonster *>(a_Entity); - ASSERT(Monster->GetParentChunk() != nullptr); // A ticking entity must have a valid parent chunk - - // Tick close mobs - if (Monster->GetParentChunk()->HasAnyClients()) - { - Monster->Tick(m_Dt, *(a_Entity->GetParentChunk())); - } - // Destroy far hostile mobs - else if ((Monster->GetMobFamily() == cMonster::eFamily::mfHostile)) - { - if (Monster->GetMobType() != eMonsterType::mtWolf) - { - Monster->Destroy(true); - } - else - { - auto Wolf = static_cast<cWolf *>(Monster); - if (Wolf->IsAngry()) - { - Monster->Destroy(true); - } - } - } - return false; - } - public: - std::chrono::milliseconds m_Dt; - } Callback; - - Callback.m_Dt = a_Dt; - ForEachEntity(Callback); } |