diff options
| author | Spp <spp@jorge.gr> | 2012-10-26 14:30:52 +0200 |
|---|---|---|
| committer | Spp <spp@jorge.gr> | 2012-10-26 14:31:19 +0200 |
| commit | 876ad50dcde63eb29c51d54e126c9d66508183ac (patch) | |
| tree | 604b0e9f6166dad9ca34cfe088709e11b05010c5 /src/server/game/AI/ScriptedAI | |
| parent | 6d55ac8c58117de36143be76d6dc8d806ac9abe7 (diff) | |
Core/Misc: Tweaked ThreatContainer internals
(and many cosmetic changes here and there)
Diffstat (limited to 'src/server/game/AI/ScriptedAI')
| -rw-r--r-- | src/server/game/AI/ScriptedAI/ScriptedCreature.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp index 76bb3aaa76a..f8025a32b7f 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp @@ -254,12 +254,11 @@ void ScriptedAI::DoResetThreat() return; } - std::list<HostileReference*>& threatlist = me->getThreatManager().getThreatList(); + ThreatContainer::StorageType threatlist = me->getThreatManager().getThreatList(); - for (std::list<HostileReference*>::iterator itr = threatlist.begin(); itr != threatlist.end(); ++itr) + for (ThreatContainer::StorageType::const_iterator itr = threatlist.begin(); itr != threatlist.end(); ++itr) { Unit* unit = Unit::GetUnit(*me, (*itr)->getUnitGuid()); - if (unit && DoGetThreat(unit)) DoModifyThreatPercent(unit, -100); } @@ -299,7 +298,8 @@ void ScriptedAI::DoTeleportPlayer(Unit* unit, float x, float y, float z, float o if (Player* player = unit->ToPlayer()) player->TeleportTo(unit->GetMapId(), x, y, z, o, TELE_TO_NOT_LEAVE_COMBAT); else - sLog->outError(LOG_FILTER_TSCR, "Creature " UI64FMTD " (Entry: %u) Tried to teleport non-player unit (Type: %u GUID: " UI64FMTD ") to x: %f y:%f z: %f o: %f. Aborted.", me->GetGUID(), me->GetEntry(), unit->GetTypeId(), unit->GetGUID(), x, y, z, o); + sLog->outError(LOG_FILTER_TSCR, "Creature " UI64FMTD " (Entry: %u) Tried to teleport non-player unit (Type: %u GUID: " UI64FMTD ") to x: %f y:%f z: %f o: %f. Aborted.", + me->GetGUID(), me->GetEntry(), unit->GetTypeId(), unit->GetGUID(), x, y, z, o); } void ScriptedAI::DoTeleportAll(float x, float y, float z, float o) @@ -331,6 +331,7 @@ std::list<Creature*> ScriptedAI::DoFindFriendlyCC(float range) Trinity::FriendlyCCedInRange u_check(me, range); Trinity::CreatureListSearcher<Trinity::FriendlyCCedInRange> searcher(me, list, u_check); me->VisitNearbyObject(range, searcher); + return list; } @@ -340,6 +341,7 @@ std::list<Creature*> ScriptedAI::DoFindFriendlyMissingBuff(float range, uint32 u Trinity::FriendlyMissingBuffInRange u_check(me, range, uiSpellid); Trinity::CreatureListSearcher<Trinity::FriendlyMissingBuffInRange> searcher(me, list, u_check); me->VisitNearbyObject(range, searcher); + return list; } @@ -451,7 +453,6 @@ void Scripted_NoMovementAI::AttackStart(Unit* target) } // BossAI - for instanced bosses - BossAI::BossAI(Creature* creature, uint32 bossId) : ScriptedAI(creature), instance(creature->GetInstanceScript()), summons(creature), @@ -503,8 +504,9 @@ void BossAI::TeleportCheaters() { float x, y, z; me->GetPosition(x, y, z); - std::list<HostileReference*>& threatList = me->getThreatManager().getThreatList(); - for (std::list<HostileReference*>::iterator itr = threatList.begin(); itr != threatList.end(); ++itr) + + ThreatContainer::StorageType threatList = me->getThreatManager().getThreatList(); + for (ThreatContainer::StorageType::const_iterator itr = threatList.begin(); itr != threatList.end(); ++itr) if (Unit* target = (*itr)->getTarget()) if (target->GetTypeId() == TYPEID_PLAYER && !CheckBoundary(target)) target->NearTeleportTo(x, y, z, 0); |
