More warning fixes

This commit is contained in:
Shauren
2011-03-08 19:11:02 +01:00
parent cbbfb52ca7
commit 9710c41a40
19 changed files with 119 additions and 96 deletions
+19 -11
View File
@@ -317,20 +317,28 @@ Unit *PetAI::SelectNextTarget()
if (me->HasReactState(REACT_PASSIVE))
return NULL;
Unit *target = NULL;
Unit *target = me->getAttackerForHelper();
targetHasCC = false;
// Check pet's attackers first to prevent dragging mobs back
// to owner
if ((target = me->getAttackerForHelper()) && !_CheckTargetCC(target)) {}
// Check owner's attackers if pet didn't have any
else if (me->GetCharmerOrOwner() && (target = me->GetCharmerOrOwner()->getAttackerForHelper()) && !_CheckTargetCC(target)) {}
// 3.0.2 - Pets now start attacking their owners target in defensive mode as soon as the hunter does
else if (me->GetCharmerOrOwner() && (target = me->GetCharmerOrOwner()->getVictim()) && !_CheckTargetCC(target)) {}
// Default
else return NULL;
// Check pet's attackers first to prevent dragging mobs back to owner
if (target && !_CheckTargetCC(target))
return target;
return target;
if (me->GetCharmerOrOwner())
{
// Check owner's attackers if pet didn't have any
target = me->GetCharmerOrOwner()->getAttackerForHelper();
if (target && !_CheckTargetCC(target))
return target;
// 3.0.2 - Pets now start attacking their owners target in defensive mode as soon as the hunter does
target = me->GetCharmerOrOwner()->getVictim();
if (target && !_CheckTargetCC(target))
return target;
}
// Default
return NULL;
}
void PetAI::HandleReturnMovement()
@@ -316,7 +316,8 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder &e)
}
else
{
switch (e.event.type)
uint32 type = e.event.type;
switch (type)
{
case SMART_EVENT_UPDATE:
case SMART_EVENT_UPDATE_IC:
@@ -149,7 +149,7 @@ enum SMART_EVENT
SMART_EVENT_GOSSIP_SELECT = 62, //1 // menuID, actionID
SMART_EVENT_JUST_CREATED = 63, //1 // none
SMART_EVENT_GOSSIP_HELLO = 64, //1 // none
SMART_EVENT_FOLLOW_COMPLETED = 65, //1 // none
SMART_EVENT_FOLLOW_COMPLETED = 65, //1 // none
SMART_EVENT_DUMMY_EFFECT = 66, //1 // spellId, effectIndex
SMART_EVENT_END = 67,