Core/Movement: Fix a potential crash on newly created pets.
Port From (https://github.com/TrinityCore/TrinityCore/commit/3d9d6fbcb80eaab72acbe6ef09b9b1c29f2439c7)
This commit is contained in:
@@ -523,7 +523,7 @@ namespace Game.Entities
|
||||
|
||||
if (creature.HasUnitTypeMask(UnitTypeMask.Minion) && !creature.IsInCombat())
|
||||
{
|
||||
var top = creature.GetMotionMaster().Top();
|
||||
var top = creature.GetMotionMaster().TopOrNull();
|
||||
if (top != null && top.GetMovementGeneratorType() == MovementGeneratorType.Follow)
|
||||
{
|
||||
Unit followed = ((AbstractFollower)top).GetTarget();
|
||||
|
||||
Reference in New Issue
Block a user