From c77ed42bf2c0dbd8b4092b5fddfb6398aebe5156 Mon Sep 17 00:00:00 2001 From: Ovahlord <18347559+Ovahlord@users.noreply.github.com> Date: Sat, 23 Aug 2025 14:36:02 +0200 Subject: [PATCH] Core/Creatures: mark summons with an expiration timer as active so they will continue to expire while no player is nearby --- .../Entities/Creature/SummonInfo/SummonInfo.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/server/game/Entities/Creature/SummonInfo/SummonInfo.cpp b/src/server/game/Entities/Creature/SummonInfo/SummonInfo.cpp index 46493adfa6..7fde3f9f51 100644 --- a/src/server/game/Entities/Creature/SummonInfo/SummonInfo.cpp +++ b/src/server/game/Entities/Creature/SummonInfo/SummonInfo.cpp @@ -160,9 +160,12 @@ void SummonInfo::HandlePreSummonActions() void SummonInfo::HandlePostSummonActions() { - Unit* summoner = GetUnitSummoner(); - if (summoner) + // If it's a summon with an expiration timer, mark it as active so its time won't stop ticking if no player is nearby + if (_remainingDuration.has_value()) + _summonedCreature->setActive(true); + + if (Unit* summoner = GetUnitSummoner()) { // Register Pet and enable its control if (_control == SummonPropertiesControl::Pet) @@ -299,18 +302,18 @@ SummonPropertiesControl SummonInfo::GetControl() const void SummonInfo::castPassiveSpells() { CreatureTemplate const* creatureInfo = _summonedCreature->GetCreatureTemplate(); - if (!creatureInfo) + if (!creatureInfo || !creatureInfo->family) return; CreatureFamilyEntry const* creatureFamilyEntry = sCreatureFamilyStore.LookupEntry(creatureInfo->family); if (!creatureFamilyEntry) return; - auto const petSpellStore = sPetFamilySpellsStore.find(creatureFamilyEntry->ID); - if (petSpellStore == sPetFamilySpellsStore.end()) + PetFamilySpellsStore::const_iterator itr = sPetFamilySpellsStore.find(creatureFamilyEntry->ID); + if (itr == sPetFamilySpellsStore.end()) return; - for (uint32 spellId : petSpellStore->second) + for (uint32 spellId : itr->second) { if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId)) {