mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 04:37:00 +00:00
[10385] Remove Unit::GetUnit and update it callers.
This commit is contained in:
parent
dcc9dc25ae
commit
77ae9a63b8
7 changed files with 40 additions and 50 deletions
|
|
@ -551,7 +551,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
|
|||
{
|
||||
ThreatList const& threatList = m_creature->getThreatManager().getThreatList();
|
||||
for (ThreatList::const_iterator i = threatList.begin(); i != threatList.end(); ++i)
|
||||
if(Unit* Temp = Unit::GetUnit(*m_creature,(*i)->getUnitGuid()))
|
||||
if(Unit* Temp = m_creature->GetMap()->GetUnit((*i)->getUnitGuid()))
|
||||
m_creature->getThreatManager().modifyThreatPercent(Temp, action.threat_all_pct.percent);
|
||||
break;
|
||||
}
|
||||
|
|
@ -652,19 +652,14 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
|
|||
break;
|
||||
case ACTION_T_QUEST_EVENT_ALL:
|
||||
if (pActionInvoker && pActionInvoker->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
if (Unit* Temp = Unit::GetUnit(*m_creature,pActionInvoker->GetGUID()))
|
||||
if (Temp->GetTypeId() == TYPEID_PLAYER)
|
||||
((Player*)Temp)->GroupEventHappens(action.quest_event_all.questId,m_creature);
|
||||
}
|
||||
((Player*)pActionInvoker)->GroupEventHappens(action.quest_event_all.questId,m_creature);
|
||||
break;
|
||||
case ACTION_T_CAST_EVENT_ALL:
|
||||
{
|
||||
ThreatList const& threatList = m_creature->getThreatManager().getThreatList();
|
||||
for (ThreatList::const_iterator i = threatList.begin(); i != threatList.end(); ++i)
|
||||
if (Unit* Temp = Unit::GetUnit(*m_creature,(*i)->getUnitGuid()))
|
||||
if (Temp->GetTypeId() == TYPEID_PLAYER)
|
||||
((Player*)Temp)->CastedCreatureOrGO(action.cast_event_all.creatureId, m_creature->GetObjectGuid(), action.cast_event_all.spellId);
|
||||
if (Player* temp = m_creature->GetMap()->GetPlayer((*i)->getUnitGuid()))
|
||||
temp->CastedCreatureOrGO(action.cast_event_all.creatureId, m_creature->GetObjectGuid(), action.cast_event_all.spellId);
|
||||
break;
|
||||
}
|
||||
case ACTION_T_REMOVEAURASFROMSPELL:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue