Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4

This commit is contained in:
Vincent-Michael committed 2014-10-10 05:29:06 +02:00
commit 63d7b348bb
39 files changed
+610 -193

No files matched your search

@@ -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))
@@ -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;
}