From 9fb59e9cf1b3c0d0ac5b30a8245cec204da9832f Mon Sep 17 00:00:00 2001 From: Andrew <47818697+Nyeriah@users.noreply.github.com> Date: Sun, 3 May 2026 14:26:50 -0300 Subject: [PATCH] fix(Core/Creature): Null-check idle motion slot in CanCreatureAttack (#25699) --- src/server/game/Entities/Creature/Creature.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 206bc6869..304f8ef93 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -2718,7 +2718,8 @@ bool Creature::CanCreatureAttack(Unit const* victim, bool skipDistCheck) const float x, y, z; x = y = z = 0.0f; - if (GetMotionMaster()->GetMotionSlot(MOTION_SLOT_IDLE)->GetResetPosition(x, y, z)) + MovementGenerator* idleSlot = GetMotionMaster()->GetMotionSlot(MOTION_SLOT_IDLE); + if (idleSlot && idleSlot->GetResetPosition(x, y, z)) return IsInDist2d(x, y, dist); else return IsInDist2d(&m_homePosition, dist);