diff options
author | LogicParrot <LogicParrot@users.noreply.github.com> | 2016-03-28 18:31:29 +0200 |
---|---|---|
committer | LogicParrot <LogicParrot@users.noreply.github.com> | 2016-04-06 08:33:43 +0200 |
commit | 5bbf033a6592f452ab87ef9154f9900e4ee5a93c (patch) | |
tree | 0066ddc00f73bf3e84b209a58ac445dce4611e2c /src/World.cpp | |
parent | Merge pull request #3102 from LogicParrot/burn (diff) | |
download | cuberite-5bbf033a6592f452ab87ef9154f9900e4ee5a93c.tar cuberite-5bbf033a6592f452ab87ef9154f9900e4ee5a93c.tar.gz cuberite-5bbf033a6592f452ab87ef9154f9900e4ee5a93c.tar.bz2 cuberite-5bbf033a6592f452ab87ef9154f9900e4ee5a93c.tar.lz cuberite-5bbf033a6592f452ab87ef9154f9900e4ee5a93c.tar.xz cuberite-5bbf033a6592f452ab87ef9154f9900e4ee5a93c.tar.zst cuberite-5bbf033a6592f452ab87ef9154f9900e4ee5a93c.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); } |