diff options
| -rw-r--r-- | src/server/game/AI/CreatureAI.cpp | 15 | ||||
| -rw-r--r-- | src/server/game/Combat/ThreatManager.cpp | 11 |
2 files changed, 16 insertions, 10 deletions
diff --git a/src/server/game/AI/CreatureAI.cpp b/src/server/game/AI/CreatureAI.cpp index 93c0076a2fa..760517851f6 100644 --- a/src/server/game/AI/CreatureAI.cpp +++ b/src/server/game/AI/CreatureAI.cpp @@ -186,15 +186,18 @@ static bool ShouldFollowOnSpawn(SummonPropertiesEntry const* properties) void CreatureAI::JustAppeared() { - if (TempSummon* summon = me->ToTempSummon()) + if (!IsEngaged()) { - // Only apply this to specific types of summons - if (!summon->GetVehicle() && ShouldFollowOnSpawn(summon->m_Properties)) + if (TempSummon* summon = me->ToTempSummon()) { - if (Unit* owner = summon->GetCharmerOrOwner()) + // Only apply this to specific types of summons + if (!summon->GetVehicle() && ShouldFollowOnSpawn(summon->m_Properties)) { - summon->GetMotionMaster()->Clear(); - summon->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, summon->GetFollowAngle()); + if (Unit* owner = summon->GetCharmerOrOwner()) + { + summon->GetMotionMaster()->Clear(); + summon->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, summon->GetFollowAngle()); + } } } } diff --git a/src/server/game/Combat/ThreatManager.cpp b/src/server/game/Combat/ThreatManager.cpp index c0998b8e33c..42518d33b47 100644 --- a/src/server/game/Combat/ThreatManager.cpp +++ b/src/server/game/Combat/ThreatManager.cpp @@ -15,12 +15,13 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ +#include "ThreatManager.h" #include "Creature.h" #include "CreatureAI.h" #include "CreatureGroups.h" #include "MotionMaster.h" #include "Player.h" -#include "ThreatManager.h" +#include "TemporarySummon.h" #include "Unit.h" #include "UnitAI.h" #include "UnitDefines.h" @@ -160,9 +161,11 @@ void ThreatReference::UnregisterAndFree() if (cWho->IsPet() || cWho->IsTotem() || cWho->IsTrigger()) return false; - // summons cannot have a threat list, unless they are controlled by a creature - if (cWho->HasUnitTypeMask(UNIT_MASK_MINION | UNIT_MASK_GUARDIAN) && !cWho->GetOwnerGUID().IsCreature()) - return false; + // summons cannot have a threat list if they were summoned by a player + if (cWho->HasUnitTypeMask(UNIT_MASK_MINION | UNIT_MASK_GUARDIAN)) + if (TempSummon const* tWho = cWho->ToTempSummon()) + if (tWho->GetSummonerGUID().IsPlayer()) + return false; return true; } |
