From de7b503cc41c8107b928077bcd689706463162da Mon Sep 17 00:00:00 2001 From: yesitsme Date: Thu, 9 Oct 2014 00:04:04 +0200 Subject: 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 --- src/server/game/AI/SmartScripts/SmartScript.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/server/game/AI/SmartScripts') 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)) -- cgit v1.2.3