diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/AI/SmartScripts/SmartAI.cpp | 5 | ||||
-rwxr-xr-x | src/server/game/Entities/Creature/Creature.cpp | 4 |
2 files changed, 8 insertions, 1 deletions
diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp index 253ac6c9155..0b77dd03e87 100644 --- a/src/server/game/AI/SmartScripts/SmartAI.cpp +++ b/src/server/game/AI/SmartScripts/SmartAI.cpp @@ -462,8 +462,11 @@ void SmartAI::EnterEvadeMode() void SmartAI::MoveInLineOfSight(Unit* who) { - if (!who) return; + if (!who) + return; + GetScript()->OnMoveInLineOfSight(who); + if (me->HasReactState(REACT_PASSIVE) || AssistPlayerInCombat(who)) return; diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 7a86136b3a8..d1f8f55e27d 100755 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -1411,6 +1411,10 @@ bool Creature::canStartAttack(Unit const* who, bool force) const if (HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PASSIVE)) return false; + + // Do not attack non-combat pets + if (who->GetTypeId() == TYPEID_UNIT && who->GetCreatureType() == CREATURE_TYPE_NON_COMBAT_PET) + return false; if (!canFly() && (GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE + m_CombatDistance)) //|| who->IsControlledByPlayer() && who->IsFlying())) |