aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormegamage <none@none>2009-08-14 22:36:32 -0500
committermegamage <none@none>2009-08-14 22:36:32 -0500
commit5983558bcc505b419ed9f1dd38dc699681942caa (patch)
tree4b207730ad6f83546a4f053420e6d2cc4894f578 /src
parent47735056cf86b9275d2bd4a6c2bf855986a10fc9 (diff)
*Let all controlled entercombat when owner/charmer enters combat.
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/Unit.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index dbc5eb3b228..da55ce24576 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -10391,18 +10391,20 @@ void Unit::SetInCombatState(bool PvP, Unit* enemy)
if(((Creature*)this)->GetFormation())
((Creature*)this)->GetFormation()->MemberAttackStart((Creature*)this, enemy);
}
+
+ if(((Creature*)this)->isPet())
+ {
+ UpdateSpeed(MOVE_RUN, true);
+ UpdateSpeed(MOVE_SWIM, true);
+ UpdateSpeed(MOVE_FLIGHT, true);
+ }
}
- if(GetTypeId() != TYPEID_PLAYER && ((Creature*)this)->isPet())
+ for(Unit::ControlList::iterator itr = m_Controlled.begin(); itr != m_Controlled.end(); ++itr)
{
- UpdateSpeed(MOVE_RUN, true);
- UpdateSpeed(MOVE_SWIM, true);
- UpdateSpeed(MOVE_FLIGHT, true);
+ (*itr)->SetInCombatState(PvP, enemy);
+ (*itr)->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PET_IN_COMBAT);
}
- else if(!isCharmed())
- return;
-
- SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PET_IN_COMBAT);
}
void Unit::ClearInCombat()