mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-14 04:02:53 -04:00
Core/Entities: Use ObjectGuid class in game project
This commit is contained in:
@@ -71,9 +71,6 @@ SmartScript::SmartScript()
|
||||
mUseTextTimer = false;
|
||||
mTalkerEntry = 0;
|
||||
mTemplate = SMARTAI_TEMPLATE_BASIC;
|
||||
meOrigGUID = 0;
|
||||
goOrigGUID = 0;
|
||||
mLastInvoker = 0;
|
||||
mScriptType = SMART_SCRIPT_TYPE_CREATURE;
|
||||
isProcessingTimedActionList = false;
|
||||
}
|
||||
@@ -99,7 +96,7 @@ void SmartScript::OnReset()
|
||||
}
|
||||
}
|
||||
ProcessEventsFor(SMART_EVENT_RESET);
|
||||
mLastInvoker = 0;
|
||||
mLastInvoker.Clear();
|
||||
}
|
||||
|
||||
void SmartScript::ProcessEventsFor(SMART_EVENT e, Unit* unit, uint32 var0, uint32 var1, bool bvar, const SpellInfo* spell, GameObject* gob)
|
||||
@@ -529,7 +526,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
go->CastSpell((*itr)->ToUnit(), e.action.cast.spell, (e.action.cast.flags & SMARTCAST_TRIGGERED) != 0);
|
||||
|
||||
TC_LOG_DEBUG("scripts.ai", "SmartScript::ProcessAction:: SMART_ACTION_CAST:: %s: %u casts spell %u on target %u with castflags %u",
|
||||
GetLogNameForGuid(me ? me->GetGUID() : go->GetGUID()), me ? me->GetGUIDLow() : go->GetGUIDLow(), e.action.cast.spell, (*itr)->GetGUIDLow(), e.action.cast.flags);
|
||||
(me ? me->GetGUID() : go->GetGUID()).GetTypeName(), me ? me->GetGUIDLow() : go->GetGUIDLow(), e.action.cast.spell, (*itr)->GetGUIDLow(), e.action.cast.flags);
|
||||
}
|
||||
else
|
||||
TC_LOG_DEBUG("scripts.ai", "Spell %u not cast because it has flag SMARTCAST_AURA_NOT_PRESENT and the target (Guid: " UI64FMTD " Entry: %u Type: %u) already has the aura", e.action.cast.spell, (*itr)->GetGUID(), (*itr)->GetEntry(), uint32((*itr)->GetTypeId()));
|
||||
@@ -959,7 +956,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
if (!targets)
|
||||
break;
|
||||
|
||||
instance->SetData64(e.action.setInstanceData64.field, targets->front()->GetGUID());
|
||||
instance->SetData64(e.action.setInstanceData64.field, targets->front()->GetGUID().GetRawValue());
|
||||
TC_LOG_DEBUG("scripts.ai", "SmartScript::ProcessAction: SMART_ACTION_SET_INST_DATA64: Field: %u, data: " UI64FMTD,
|
||||
e.action.setInstanceData64.field, targets->front()->GetGUID());
|
||||
|
||||
@@ -1578,20 +1575,20 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
{
|
||||
if (IsCreature(*itr))
|
||||
{
|
||||
if (!meOrigGUID)
|
||||
meOrigGUID = me ? me->GetGUID() : 0;
|
||||
if (!goOrigGUID)
|
||||
goOrigGUID = go ? go->GetGUID() : 0;
|
||||
if (!meOrigGUID && me)
|
||||
meOrigGUID = me->GetGUID();
|
||||
if (!goOrigGUID && go)
|
||||
goOrigGUID = go->GetGUID();
|
||||
go = NULL;
|
||||
me = (*itr)->ToCreature();
|
||||
break;
|
||||
}
|
||||
else if (IsGameObject(*itr))
|
||||
{
|
||||
if (!meOrigGUID)
|
||||
meOrigGUID = me ? me->GetGUID() : 0;
|
||||
if (!goOrigGUID)
|
||||
goOrigGUID = go ? go->GetGUID() : 0;
|
||||
if (!meOrigGUID && me)
|
||||
meOrigGUID = me->GetGUID();
|
||||
if (!goOrigGUID && go)
|
||||
goOrigGUID = go->GetGUID();
|
||||
go = (*itr)->ToGameObject();
|
||||
me = NULL;
|
||||
break;
|
||||
@@ -2647,7 +2644,7 @@ ObjectList* SmartScript::GetTargets(SmartScriptHolder const& e, Unit* invoker /*
|
||||
{
|
||||
if (me)
|
||||
{
|
||||
uint64 charmerOrOwnerGuid = me->GetCharmerOrOwnerGUID();
|
||||
ObjectGuid charmerOrOwnerGuid = me->GetCharmerOrOwnerGUID();
|
||||
|
||||
if (!charmerOrOwnerGuid)
|
||||
charmerOrOwnerGuid = me->GetCreatorGUID();
|
||||
|
||||
Reference in New Issue
Block a user