Skip to content

Commit

Permalink
Fix some behavioral weirdness resulting from 79a945d - thanks ccrs.
Browse files Browse the repository at this point in the history
(cherry picked from commit bfac62c)
  • Loading branch information
Treeston authored and Shauren committed Apr 8, 2016
1 parent f4baf7c commit 3f6b215
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
3 changes: 0 additions & 3 deletions src/server/game/AI/CreatureAI.cpp
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/server/game/Entities/Unit/Unit.cpp
Expand Up @@ -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();
Expand Down

0 comments on commit 3f6b215

Please sign in to comment.