aboutsummaryrefslogtreecommitdiff
path: root/src/game/Unit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r--src/game/Unit.cpp21
1 files changed, 9 insertions, 12 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 8427c22b677..5660f8a561b 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -519,9 +519,6 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
return damage;
}
-
- if(!pVictim->isInCombat() && ((Creature*)pVictim)->AI())
- ((Creature*)pVictim)->AI()->AttackStart(this);
}
DEBUG_LOG("DealDamageStart");
@@ -539,15 +536,6 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
duel_hasEnded = true;
}
- //Get in CombatState
- if(pVictim != this && damagetype != DOT)
- {
- SetInCombatWith(pVictim);
- pVictim->SetInCombatWith(this);
-
- if(Player* attackedPlayer = pVictim->GetCharmerOrOwnerPlayerOrPlayerItself())
- SetContestedPvP(attackedPlayer);
- }
// Rage from Damage made (only from direct weapon damage)
if( cleanDamage && damagetype==DIRECT_DAMAGE && this != pVictim && GetTypeId() == TYPEID_PLAYER && (getPowerType() == POWER_RAGE))
@@ -2151,6 +2139,15 @@ void Unit::AttackerStateUpdate (Unit *pVictim, WeaponAttackType attType, bool ex
if(IsNonMeleeSpellCasted(false))
return;
+ if(!pVictim->isInCombat() && pVictim->GetTypeId() != TYPEID_PLAYER && ((Creature*)pVictim)->AI())
+ ((Creature*)pVictim)->AI()->AttackStart(this);
+
+ SetInCombatWith(pVictim);
+ pVictim->SetInCombatWith(this);
+
+ if(Player* attackedPlayer = pVictim->GetCharmerOrOwnerPlayerOrPlayerItself())
+ SetContestedPvP(attackedPlayer);
+
uint32 hitInfo;
if (attType == BASE_ATTACK)
hitInfo = HITINFO_NORMALSWING2;