diff options
author | megamage <none@none> | 2009-01-16 19:34:49 -0600 |
---|---|---|
committer | megamage <none@none> | 2009-01-16 19:34:49 -0600 |
commit | 0f150881a12e7c7936e9672dc1a7b25778a65589 (patch) | |
tree | 550f517822a7108fd4e47e4a14e2cf45684ab373 /src/game/Unit.cpp | |
parent | ba4338783abb39dcee772511a61d671e6c0256ab (diff) |
*Do not let target get in combat until hit by attacker.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r-- | src/game/Unit.cpp | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 900c7526fad..734182fa4cf 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -9697,23 +9697,12 @@ void Unit::CombatStart(Unit* target) if(!target->IsStandState()/* && !target->hasUnitState(UNIT_STAT_STUNNED)*/) target->SetStandState(PLAYER_STATE_NONE); - //Call creature group update - if(GetTypeId()==TYPEID_UNIT && ((Creature *)this)->GetFormationID() && - CreatureGroupHolder.find(((Creature *)this)->GetFormationID()) != CreatureGroupHolder.end()) - CreatureGroupHolder[((Creature *)this)->GetFormationID()]->MemberHasAttacked(((Creature *)this)); - if(!target->isInCombat() && target->GetTypeId() != TYPEID_PLAYER && !((Creature*)target)->HasReactState(REACT_PASSIVE) && ((Creature*)target)->AI()) - { - SetInCombatWith(target); - target->SetInCombatWith(this); ((Creature*)target)->AI()->AttackStart(this); - } - else - { - SetInCombatWith(target); - target->SetInCombatWith(this); - } + + SetInCombatWith(target); + target->SetInCombatWith(this); Unit *who = target->GetCharmerOrOwnerOrSelf(); if(who->GetTypeId() == TYPEID_PLAYER) @@ -9727,6 +9716,14 @@ void Unit::CombatStart(Unit* target) me->UpdatePvP(true); me->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT); } + + //Call creature group update + if(GetTypeId()==TYPEID_UNIT && ((Creature*)this)->GetFormationID()) + { + CreatureGroupHolderType::iterator itr = CreatureGroupHolder.find(((Creature*)this)->GetFormationID()); + if(itr != CreatureGroupHolder.end()) + itr->second->MemberHasAttacked(((Creature*)this)); + } } void Unit::SetInCombatState(bool PvP) |