aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bindings/scripts/include/sc_creature.cpp3
-rw-r--r--src/bindings/scripts/scripts/creature/mob_event_ai.cpp2
-rw-r--r--src/bindings/scripts/scripts/npc/npc_escortAI.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/black_temple/boss_shade_of_akama.cpp1
-rw-r--r--src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_nethekurse.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/shattrath/shattrath_city.cpp1
-rw-r--r--src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/arcatraz.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_kaelthas.cpp5
-rw-r--r--src/game/AggressorAI.cpp3
-rw-r--r--src/game/GuardAI.cpp3
-rw-r--r--src/game/PetAI.cpp2
-rw-r--r--src/game/ReactorAI.cpp2
-rw-r--r--src/game/Unit.cpp5
13 files changed, 5 insertions, 28 deletions
diff --git a/src/bindings/scripts/include/sc_creature.cpp b/src/bindings/scripts/include/sc_creature.cpp
index 82e7ab04ca9..c2ae15d9ab1 100644
--- a/src/bindings/scripts/include/sc_creature.cpp
+++ b/src/bindings/scripts/include/sc_creature.cpp
@@ -85,7 +85,6 @@ void ScriptedAI::AttackStart(Unit* who, bool melee)
if (m_creature->Attack(who, melee))
{
m_creature->AddThreat(who, 0.0f);
- m_creature->SetInCombatWith(who);
if (!InCombat)
{
@@ -108,7 +107,6 @@ void ScriptedAI::AttackStart(Unit* who)
if (m_creature->Attack(who, true))
{
m_creature->AddThreat(who, 0.0f);
- m_creature->SetInCombatWith(who);
if (!InCombat)
{
@@ -834,7 +832,6 @@ void Scripted_NoMovementAI::AttackStart(Unit* who)
if (m_creature->Attack(who, true))
{
m_creature->AddThreat(who, 0.0f);
- m_creature->SetInCombatWith(who);
if (!InCombat)
{
diff --git a/src/bindings/scripts/scripts/creature/mob_event_ai.cpp b/src/bindings/scripts/scripts/creature/mob_event_ai.cpp
index 6b46b7aecde..17b2c1b5ace 100644
--- a/src/bindings/scripts/scripts/creature/mob_event_ai.cpp
+++ b/src/bindings/scripts/scripts/creature/mob_event_ai.cpp
@@ -1150,8 +1150,6 @@ struct TRINITY_DLL_DECL Mob_EventAI : public ScriptedAI
if (m_creature->Attack(who, MeleeEnabled))
{
//Begin melee attack if we are within range
- m_creature->AddThreat(who, 0.0f);
- m_creature->SetInCombatWith(who);
if (!InCombat)
{
diff --git a/src/bindings/scripts/scripts/npc/npc_escortAI.cpp b/src/bindings/scripts/scripts/npc/npc_escortAI.cpp
index 88505c44caf..20e6345b9f7 100644
--- a/src/bindings/scripts/scripts/npc/npc_escortAI.cpp
+++ b/src/bindings/scripts/scripts/npc/npc_escortAI.cpp
@@ -35,8 +35,6 @@ void npc_escortAI::AttackStart(Unit *who)
if ( m_creature->Attack(who, true) )
{
m_creature->AddThreat(who, 0.0f);
- m_creature->SetInCombatWith(who);
- who->SetInCombatWith(m_creature);
if (!InCombat)
{
diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_shade_of_akama.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_shade_of_akama.cpp
index a29a2db9321..be2c1830409 100644
--- a/src/bindings/scripts/scripts/zone/black_temple/boss_shade_of_akama.cpp
+++ b/src/bindings/scripts/scripts/zone/black_temple/boss_shade_of_akama.cpp
@@ -440,7 +440,6 @@ struct TRINITY_DLL_DECL boss_shade_of_akamaAI : public ScriptedAI
Akama->AddThreat(m_creature, 10000000.0f);
m_creature->Attack(Akama, true);
Akama->Attack(m_creature, true);
- m_creature->SetInCombatWith(Akama);
}
}
}
diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_nethekurse.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_nethekurse.cpp
index d152536359b..c8027abaa5b 100644
--- a/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_nethekurse.cpp
+++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_nethekurse.cpp
@@ -170,8 +170,6 @@ struct TRINITY_DLL_DECL boss_grand_warlock_nethekurseAI : public ScriptedAI
if (m_creature->Attack(who, true))
{
m_creature->AddThreat(who, 0.0f);
- m_creature->SetInCombatWith(who);
- who->SetInCombatWith(m_creature);
if (!InCombat)
{
diff --git a/src/bindings/scripts/scripts/zone/shattrath/shattrath_city.cpp b/src/bindings/scripts/scripts/zone/shattrath/shattrath_city.cpp
index 22f71e09be0..0709342d424 100644
--- a/src/bindings/scripts/scripts/zone/shattrath/shattrath_city.cpp
+++ b/src/bindings/scripts/scripts/zone/shattrath/shattrath_city.cpp
@@ -522,7 +522,6 @@ struct TRINITY_DLL_DECL npc_dirty_larryAI : public ScriptedAI
Malone->setFaction(14);
Malone->GetMotionMaster()->MoveChase(player);
}
- m_creature->SetInCombatWith(player);
DoStartMovement(player);
AttackStart(player);
}
diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/arcatraz.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/arcatraz.cpp
index d4433c7afe5..febecd13ce1 100644
--- a/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/arcatraz.cpp
+++ b/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/arcatraz.cpp
@@ -104,8 +104,6 @@ struct TRINITY_DLL_DECL npc_millhouse_manastormAI : public ScriptedAI
if (m_creature->Attack(who, true))
{
m_creature->AddThreat(who, 0.0f);
- m_creature->SetInCombatWith(who);
- who->SetInCombatWith(m_creature);
if (!InCombat)
{
diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_kaelthas.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_kaelthas.cpp
index d46f7cf519f..39627a30cfb 100644
--- a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_kaelthas.cpp
+++ b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_kaelthas.cpp
@@ -1211,8 +1211,6 @@ struct TRINITY_DLL_DECL boss_grand_astromancer_capernianAI : public advisorbase_
if (m_creature->Attack(who, true))
{
m_creature->AddThreat(who, 0.0f);
- m_creature->SetInCombatWith(who);
- who->SetInCombatWith(m_creature);
if (!InCombat)
{
@@ -1497,9 +1495,6 @@ struct TRINITY_DLL_DECL mob_phoenix_egg_tkAI : public ScriptedAI
{
if (m_creature->Attack(who, false))
{
- m_creature->SetInCombatWith(who);
- who->SetInCombatWith(m_creature);
-
if (!InCombat)
{
InCombat = true;
diff --git a/src/game/AggressorAI.cpp b/src/game/AggressorAI.cpp
index 99e39618f53..a11584eab64 100644
--- a/src/game/AggressorAI.cpp
+++ b/src/game/AggressorAI.cpp
@@ -148,9 +148,6 @@ AggressorAI::AttackStart(Unit *u)
if(i_creature.Attack(u,true))
{
- i_creature.SetInCombatWith(u);
- u->SetInCombatWith(&i_creature);
-
i_creature.AddThreat(u, 0.0f);
// DEBUG_LOG("Creature %s tagged a victim to kill [guid=%u]", i_creature.GetName(), u->GetGUIDLow());
i_victimGuid = u->GetGUID();
diff --git a/src/game/GuardAI.cpp b/src/game/GuardAI.cpp
index e5a7ce87092..273fa32272b 100644
--- a/src/game/GuardAI.cpp
+++ b/src/game/GuardAI.cpp
@@ -139,9 +139,6 @@ void GuardAI::AttackStart(Unit *u)
// DEBUG_LOG("Creature %s tagged a victim to kill [guid=%u]", i_creature.GetName(), u->GetGUIDLow());
if(i_creature.Attack(u,true))
{
- i_creature.SetInCombatWith(u);
- u->SetInCombatWith(&i_creature);
-
i_creature.AddThreat(u, 0.0f);
i_victimGuid = u->GetGUID();
i_creature.GetMotionMaster()->MoveChase(u);
diff --git a/src/game/PetAI.cpp b/src/game/PetAI.cpp
index 85c2a77c921..bce8a4d8f59 100644
--- a/src/game/PetAI.cpp
+++ b/src/game/PetAI.cpp
@@ -73,8 +73,6 @@ void PetAI::AttackStart(Unit *u)
if(i_pet.Attack(u,true))
{
- i_pet.SetInCombatWith(u);
-
i_pet.clearUnitState(UNIT_STAT_FOLLOW);
// TMGs call CreatureRelocation which via MoveInLineOfSight can call this function
// thus with the following clear the original TMG gets invalidated and crash, doh
diff --git a/src/game/ReactorAI.cpp b/src/game/ReactorAI.cpp
index dd796b74f38..7ade73495c3 100644
--- a/src/game/ReactorAI.cpp
+++ b/src/game/ReactorAI.cpp
@@ -50,8 +50,6 @@ ReactorAI::AttackStart(Unit *p)
if(i_creature.Attack(p,true))
{
DEBUG_LOG("Tag unit GUID: %u (TypeId: %u) as a victim", p->GetGUIDLow(), p->GetTypeId());
- i_creature.SetInCombatWith(p);
- p->SetInCombatWith(&i_creature);
i_creature.AddThreat(p, 0.0f);
i_victimGuid = p->GetGUID();
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 7c8c9179962..a2b4aba30fd 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -8203,6 +8203,11 @@ bool Unit::Attack(Unit *victim, bool meleeAttack)
((WorldObject*)this)->SendMessageToSet(&data, true);
((Creature*)this)->CallAssistance();
+
+ // should not let player enter combat by right clicking target
+ SetInCombatWith(victim);
+ if(victim->GetTypeId() == TYPEID_PLAYER)
+ victim->SetInCombatWith(this);
}
// delay offhand weapon attack to next attack time