From 3f6b215fcae543aa4ac0a6cfadebf61a7157575d Mon Sep 17 00:00:00 2001 From: treeston Date: Sun, 28 Feb 2016 01:56:13 +0100 Subject: Fix some behavioral weirdness resulting from 79a945d5 - thanks ccrs. (cherry picked from commit bfac62c5c914efe1576d39504d5dd75f11f41237) --- src/server/game/AI/CreatureAI.cpp | 3 --- src/server/game/Entities/Unit/Unit.cpp | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) (limited to 'src') diff --git a/src/server/game/AI/CreatureAI.cpp b/src/server/game/AI/CreatureAI.cpp index 33de8b09123..352ae635878 100644 --- a/src/server/game/AI/CreatureAI.cpp +++ b/src/server/game/AI/CreatureAI.cpp @@ -134,10 +134,7 @@ void CreatureAI::MoveInLineOfSight(Unit* who) return; if (me->HasReactState(REACT_AGGRESSIVE) && me->CanStartAttack(who, false)) - { - me->AddThreat(who, 0.0f); // ensure our initial target is the first thing added to threat list so we don't randomly switch off if DoZoneInCombat is called during the EnterCombat hook AttackStart(who); - } //else if (who->GetVictim() && me->IsFriendlyTo(who) // && me->IsWithinDistInMap(who, sWorld->getIntConfig(CONFIG_CREATURE_FAMILY_ASSISTANCE_RADIUS)) // && me->CanStartAttack(who->GetVictim(), true)) /// @todo if we use true, it will not attack it when it arrives diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index d983e307f10..439a3621d69 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -7303,10 +7303,10 @@ bool Unit::Attack(Unit* victim, bool meleeAttack) if (GetTypeId() == TYPEID_UNIT && !IsPet()) { // should not let player enter combat by right clicking target - doesn't helps + AddThreat(victim, 0.0f); SetInCombatWith(victim); if (victim->GetTypeId() == TYPEID_PLAYER) victim->SetInCombatWith(this); - AddThreat(victim, 0.0f); ToCreature()->SendAIReaction(AI_REACTION_HOSTILE); ToCreature()->CallAssistance(); -- cgit v1.2.3