File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
src/server/game/Entities/Creature/SummonInfo Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -160,9 +160,12 @@ void SummonInfo::HandlePreSummonActions()
160160
161161void SummonInfo::HandlePostSummonActions ()
162162{
163- Unit* summoner = GetUnitSummoner ();
164163
165- if (summoner)
164+ // 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
165+ if (_remainingDuration.has_value ())
166+ _summonedCreature->setActive (true );
167+
168+ if (Unit* summoner = GetUnitSummoner ())
166169 {
167170 // Register Pet and enable its control
168171 if (_control == SummonPropertiesControl::Pet)
@@ -299,18 +302,18 @@ SummonPropertiesControl SummonInfo::GetControl() const
299302void SummonInfo::castPassiveSpells ()
300303{
301304 CreatureTemplate const * creatureInfo = _summonedCreature->GetCreatureTemplate ();
302- if (!creatureInfo)
305+ if (!creatureInfo || !creatureInfo-> family )
303306 return ;
304307
305308 CreatureFamilyEntry const * creatureFamilyEntry = sCreatureFamilyStore .LookupEntry (creatureInfo->family );
306309 if (!creatureFamilyEntry)
307310 return ;
308311
309- auto const petSpellStore = sPetFamilySpellsStore .find (creatureFamilyEntry->ID );
310- if (petSpellStore == sPetFamilySpellsStore .end ())
312+ PetFamilySpellsStore::const_iterator itr = sPetFamilySpellsStore .find (creatureFamilyEntry->ID );
313+ if (itr == sPetFamilySpellsStore .end ())
311314 return ;
312315
313- for (uint32 spellId : petSpellStore ->second )
316+ for (uint32 spellId : itr ->second )
314317 {
315318 if (SpellInfo const * spellInfo = sSpellMgr ->GetSpellInfo (spellId))
316319 {
You can’t perform that action at this time.
0 commit comments