aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/AI/CreatureAI.cpp
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2019-06-24 18:47:04 +0200
committerShauren <shauren.trinity@gmail.com>2021-12-12 02:20:42 +0100
commit1c00109756815b6888303b31748595521fd7809c (patch)
treeccd4a33f751bbda039d082095de8f37b5867a965 /src/server/game/AI/CreatureAI.cpp
parentaadb9ab55f2338310c338210e7e4c9114416c723 (diff)
Core/Creatures: Fixed crash in CreatureAI::JustAppeared caused by scripted summons without SummonProperties
Closes #23507 (cherry picked from commit c0b25c9a83126bfd26da8245a31ea684008d804d)
Diffstat (limited to 'src/server/game/AI/CreatureAI.cpp')
-rw-r--r--src/server/game/AI/CreatureAI.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/server/game/AI/CreatureAI.cpp b/src/server/game/AI/CreatureAI.cpp
index dd729428934..c74fd04ce57 100644
--- a/src/server/game/AI/CreatureAI.cpp
+++ b/src/server/game/AI/CreatureAI.cpp
@@ -165,8 +165,9 @@ void CreatureAI::JustAppeared()
if (!me->IsSummon())
return;
+ // Summons without SummonProperties are generally scripted summons that don't belong to any owner
TempSummon* summon = me->ToTempSummon();
- if (summon->m_Properties->Control != SUMMON_CATEGORY_UNK && summon->m_Properties->Control != SUMMON_CATEGORY_PET)
+ if (!summon->m_Properties || (summon->m_Properties->Control != SUMMON_CATEGORY_UNK && summon->m_Properties->Control != SUMMON_CATEGORY_PET))
return;
// Not applied to vehicles