diff options
author | yesitsme <lucas__jensen@hotmail.com> | 2014-10-09 00:04:04 +0200 |
---|---|---|
committer | yesitsme <lucas__jensen@hotmail.com> | 2014-10-09 00:04:04 +0200 |
commit | de7b503cc41c8107b928077bcd689706463162da (patch) | |
tree | ba36d9e7618b36288101894a6659865a3008f006 /src | |
parent | 2e455eee86e69265712dda4f0e82056765961d41 (diff) |
Core/SmartScripts: Fix multiple target_types
Checking the worldobjects GUID against the iterators GUID instead of pointer to worldobject against pointer to iterator, as 2 different pointers may point to the same object.
Closes #12670
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/AI/SmartScripts/SmartScript.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 620d28ce379..b877a4ca2c0 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -2458,7 +2458,7 @@ ObjectList* SmartScript::GetTargets(SmartScriptHolder const& e, Unit* invoker /* if (!IsCreature(*itr)) continue; - if (me && me == *itr) + if (me && me->GetGUID() == (*itr)->GetGUID()) continue; if (((e.target.unitRange.creature && (*itr)->ToCreature()->GetEntry() == e.target.unitRange.creature) || !e.target.unitRange.creature) && baseObject->IsInRange(*itr, (float)e.target.unitRange.minDist, (float)e.target.unitRange.maxDist)) @@ -2477,7 +2477,7 @@ ObjectList* SmartScript::GetTargets(SmartScriptHolder const& e, Unit* invoker /* if (!IsCreature(*itr)) continue; - if (me && me == *itr) + if (me && me->GetGUID() == (*itr)->GetGUID()) continue; if ((e.target.unitDistance.creature && (*itr)->ToCreature()->GetEntry() == e.target.unitDistance.creature) || !e.target.unitDistance.creature) @@ -2496,7 +2496,7 @@ ObjectList* SmartScript::GetTargets(SmartScriptHolder const& e, Unit* invoker /* if (!IsGameObject(*itr)) continue; - if (go && go == *itr) + if (go && go->GetGUID() == (*itr)->GetGUID()) continue; if ((e.target.goDistance.entry && (*itr)->ToGameObject()->GetEntry() == e.target.goDistance.entry) || !e.target.goDistance.entry) @@ -2515,7 +2515,7 @@ ObjectList* SmartScript::GetTargets(SmartScriptHolder const& e, Unit* invoker /* if (!IsGameObject(*itr)) continue; - if (go && go == *itr) + if (go && go->GetGUID() == (*itr)->GetGUID()) continue; if (((e.target.goRange.entry && IsGameObject(*itr) && (*itr)->ToGameObject()->GetEntry() == e.target.goRange.entry) || !e.target.goRange.entry) && baseObject->IsInRange((*itr), (float)e.target.goRange.minDist, (float)e.target.goRange.maxDist)) |