diff options
Diffstat (limited to '')
-rw-r--r-- | src/Entities/Pawn.cpp | 52 |
1 files changed, 1 insertions, 51 deletions
diff --git a/src/Entities/Pawn.cpp b/src/Entities/Pawn.cpp index a116f97e3..ac8e4b1ab 100644 --- a/src/Entities/Pawn.cpp +++ b/src/Entities/Pawn.cpp @@ -29,7 +29,7 @@ cPawn::cPawn(eEntityType a_EntityType, double a_Width, double a_Height) : cPawn::~cPawn() { - ASSERT(m_TargetingMe.size() == 0); + } @@ -38,7 +38,6 @@ cPawn::~cPawn() void cPawn::Destroyed() { - StopEveryoneFromTargetingMe(); super::Destroyed(); } @@ -248,38 +247,6 @@ void cPawn::ClearEntityEffects() -void cPawn::NoLongerTargetingMe(cMonster * a_Monster) -{ - ASSERT(IsTicking()); // Our destroy override is supposed to clear all targets before we're destroyed. - for (auto i = m_TargetingMe.begin(); i != m_TargetingMe.end(); ++i) - { - cMonster * Monster = *i; - if (Monster == a_Monster) - { - ASSERT(Monster->GetTarget() != this); // The monster is notifying us it is no longer targeting us, assert if that's a lie - m_TargetingMe.erase(i); - return; - } - } - ASSERT(false); // If this happens, something is wrong. Perhaps the monster never called TargetingMe() or called NoLongerTargetingMe() twice. -} - - - - - -void cPawn::TargetingMe(cMonster * a_Monster) -{ - ASSERT(IsTicking()); - ASSERT(m_TargetingMe.size() < 10000); - ASSERT(a_Monster->GetTarget() == this); - m_TargetingMe.push_back(a_Monster); -} - - - - - void cPawn::HandleFalling(void) { /* Not pretty looking, and is more suited to wherever server-sided collision detection is implemented. @@ -450,23 +417,6 @@ void cPawn::HandleFalling(void) -void cPawn::StopEveryoneFromTargetingMe() -{ - std::vector<cMonster*>::iterator i = m_TargetingMe.begin(); - while (i != m_TargetingMe.end()) - { - cMonster * Monster = *i; - ASSERT(Monster->GetTarget() == this); - Monster->UnsafeUnsetTarget(); - i = m_TargetingMe.erase(i); - } - ASSERT(m_TargetingMe.size() == 0); -} - - - - - std::map<cEntityEffect::eType, cEntityEffect *> cPawn::GetEntityEffects() { std::map<cEntityEffect::eType, cEntityEffect *> Effects; |