Core/SmartScripts: Fixed SAI targets 10 & 14 (SMART_TARGET_CREATURE_GUID, SMART_TARGET_GAMEOBJECT_GUID)
Note: If you used these targets to perform actions across maps, it will not work anymore, this functionality is deprecated as it was not safe.
This commit is contained in:
1 parent
6a29a957dd
commit
59e4f6eb05
2 files changed
+14
-30
No files matched your search
@@ -2260,46 +2260,30 @@ ObjectList* SmartScript::GetTargets(SmartScriptHolder const& e, Unit* invoker /*
|
||||
case SMART_TARGET_CREATURE_GUID:
|
||||
{
|
||||
Creature* target = NULL;
|
||||
if (e.target.unitGUID.entry)
|
||||
if (!trigger && !GetBaseObject())
|
||||
{
|
||||
uint64 guid = MAKE_NEW_GUID(e.target.unitGUID.guid, e.target.unitGUID.entry, HIGHGUID_UNIT);
|
||||
target = HashMapHolder<Creature>::Find(guid);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!trigger && !GetBaseObject())
|
||||
{
|
||||
sLog->outError(LOG_FILTER_SQL, "SMART_TARGET_CREATURE_GUID can not be used without invoker and without entry");
|
||||
break;
|
||||
}
|
||||
|
||||
target = FindCreatureNear(trigger ? trigger : GetBaseObject(), e.target.unitGUID.guid);
|
||||
sLog->outError(LOG_FILTER_SQL, "SMART_TARGET_CREATURE_GUID can not be used without invoker");
|
||||
break;
|
||||
}
|
||||
|
||||
if (target)
|
||||
target = FindCreatureNear(trigger ? trigger : GetBaseObject(), e.target.unitGUID.dbGuid);
|
||||
|
||||
if (target && (!e.target.unitGUID.entry || target->GetEntry() == e.target.unitGUID.entry))
|
||||
l->push_back(target);
|
||||
break;
|
||||
}
|
||||
case SMART_TARGET_GAMEOBJECT_GUID:
|
||||
{
|
||||
GameObject* target = NULL;
|
||||
if (e.target.unitGUID.entry)
|
||||
if (!trigger && !GetBaseObject())
|
||||
{
|
||||
uint64 guid = MAKE_NEW_GUID(e.target.goGUID.guid, e.target.goGUID.entry, HIGHGUID_GAMEOBJECT);
|
||||
target = HashMapHolder<GameObject>::Find(guid);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!trigger && !GetBaseObject())
|
||||
{
|
||||
sLog->outError(LOG_FILTER_SQL, "SMART_TARGET_GAMEOBJECT_GUID can not be used without invoker and without entry");
|
||||
break;
|
||||
}
|
||||
|
||||
target = FindGameObjectNear(trigger ? trigger : GetBaseObject(), e.target.goGUID.guid);
|
||||
sLog->outError(LOG_FILTER_SQL, "SMART_TARGET_GAMEOBJECT_GUID can not be used without invoker");
|
||||
break;
|
||||
}
|
||||
|
||||
if (target)
|
||||
target = FindGameObjectNear(trigger ? trigger : GetBaseObject(), e.target.goGUID.dbGuid);
|
||||
|
||||
if (target && (!e.target.goGUID.entry || target->GetEntry() == e.target.goGUID.entry))
|
||||
l->push_back(target);
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user