diff options
author | QAston <none@none> | 2009-07-13 15:38:48 +0200 |
---|---|---|
committer | QAston <none@none> | 2009-07-13 15:38:48 +0200 |
commit | aee2b181601deae514865f1350194f0c589b7db0 (patch) | |
tree | d703f80895470962e8ac6ccb337f07a8be29b4d8 /src/game/Unit.cpp | |
parent | 3b6aacb512e6751ac67fed80e16c7f1b77a4d610 (diff) |
*Set pvp flag for spells with SPELL_ATTR_EX3_NO_INITIAL_AGGRO if needed.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r-- | src/game/Unit.cpp | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 1be089e66bc..02e6f8fd440 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -10455,20 +10455,22 @@ void Unit::SetInCombatWith(Unit* enemy) SetInCombatState(false,enemy); } -void Unit::CombatStart(Unit* target) +void Unit::CombatStart(Unit* target, bool initialAggro) { - if(!target->IsStandState()/* && !target->hasUnitState(UNIT_STAT_STUNNED)*/) - target->SetStandState(UNIT_STAND_STATE_STAND); - - if(!target->isInCombat() && target->GetTypeId() != TYPEID_PLAYER - && !((Creature*)target)->HasReactState(REACT_PASSIVE) && ((Creature*)target)->IsAIEnabled) + if (initialAggro) { - ((Creature*)target)->AI()->AttackStart(this); - } + if(!target->IsStandState()/* && !target->hasUnitState(UNIT_STAT_STUNNED)*/) + target->SetStandState(UNIT_STAND_STATE_STAND); - SetInCombatWith(target); - target->SetInCombatWith(this); + if(!target->isInCombat() && target->GetTypeId() != TYPEID_PLAYER + && !((Creature*)target)->HasReactState(REACT_PASSIVE) && ((Creature*)target)->IsAIEnabled) + { + ((Creature*)target)->AI()->AttackStart(this); + } + SetInCombatWith(target); + target->SetInCombatWith(this); + } Unit *who = target->GetCharmerOrOwnerOrSelf(); if(who->GetTypeId() == TYPEID_PLAYER) SetContestedPvP((Player*)who); |