aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/AI
diff options
context:
space:
mode:
authorVincent-Michael <Vincent_Michael@gmx.de>2014-10-10 05:29:06 +0200
committerVincent-Michael <Vincent_Michael@gmx.de>2014-10-10 05:29:06 +0200
commit63d7b348bb1c654ee72bbbb3f29c7a78ee462408 (patch)
tree2f0499d553aeb9581c0d40668af9fc0872c9ed48 /src/server/game/AI
parent0fb9ba4f2848cf5a7e263e1b9d58cf101d063e85 (diff)
parent67f9d916cbd920ee72b3e9036e13d0725b38566e (diff)
Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4
Diffstat (limited to 'src/server/game/AI')
-rw-r--r--src/server/game/AI/SmartScripts/SmartScript.cpp8
-rw-r--r--src/server/game/AI/SmartScripts/SmartScriptMgr.cpp23
2 files changed, 25 insertions, 6 deletions
diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp
index fb3bbd17a69..186259a5b8d 100644
--- a/src/server/game/AI/SmartScripts/SmartScript.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScript.cpp
@@ -2468,7 +2468,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))
@@ -2487,7 +2487,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)
@@ -2506,7 +2506,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)
@@ -2525,7 +2525,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))
diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
index bd63d0fb413..0698e12413f 100644
--- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
@@ -1220,7 +1220,26 @@ bool SmartAIMgr::IsTextValid(SmartScriptHolder const& e, uint32 id) // unused
uint32 entry = 0;
if (e.entryOrGuid >= 0)
- entry = uint32(e.entryOrGuid);
+ {
+ if (e.GetEventType() == SMART_EVENT_TEXT_OVER)
+ {
+ entry = e.event.textOver.creatureEntry;
+ id = e.event.textOver.textGroupID;
+ }
+ else
+ {
+ switch (e.GetTargetType())
+ {
+ case SMART_TARGET_CREATURE_DISTANCE:
+ case SMART_TARGET_CREATURE_RANGE:
+ case SMART_TARGET_CLOSEST_CREATURE:
+ return true; // ignore
+ default:
+ entry = uint32(e.entryOrGuid);
+ break;
+ }
+ }
+ }
else
{
entry = uint32(abs(e.entryOrGuid));
@@ -1239,7 +1258,7 @@ bool SmartAIMgr::IsTextValid(SmartScriptHolder const& e, uint32 id) // unused
if (error)
{
- TC_LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u using non-existent Text id %d, skipped.", e.entryOrGuid, e.GetScriptType(), e.source_type, e.GetActionType(), id);
+ TC_LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u using non-existent Text id %d, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), id);
return false;
}