Core/Spells: Implemented SummonPropertiesFlags::UseDemonTimeout

Closes #29930

(cherry picked from commit c15c8609f0)
This commit is contained in:
Shauren
2024-05-19 00:55:24 +02:00
committed by Ovahlord
parent bfd8e907d9
commit ae687002d1
2 changed files with 9 additions and 2 deletions

View File

@@ -2099,7 +2099,7 @@ enum class SummonPropertiesFlags : uint32
DespawnOnSummonerDeath = 0x00000008, // NYI
OnlyVisibleToSummoner = 0x00000010,
CannotDismissPet = 0x00000020, // NYI
UseDemonTimeout = 0x00000040, // NYI
UseDemonTimeout = 0x00000040,
UnlimitedSummons = 0x00000080, // NYI
UseCreatureLevel = 0x00000100,
JoinSummonerSpawnGroup = 0x00000200, // NYI

View File

@@ -193,7 +193,14 @@ void TempSummon::InitStats(WorldObject* summoner, Milliseconds duration)
m_lifetime = duration;
if (m_type == TEMPSUMMON_MANUAL_DESPAWN)
m_type = (duration <= 0ms) ? TEMPSUMMON_DEAD_DESPAWN : TEMPSUMMON_TIMED_DESPAWN;
{
if (duration <= 0s)
m_type = TEMPSUMMON_DEAD_DESPAWN;
else if (m_Properties && m_Properties->GetFlags().HasFlag(SummonPropertiesFlags::UseDemonTimeout))
m_type = TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT;
else
m_type = TEMPSUMMON_TIMED_DESPAWN;
}
if (summoner && summoner->IsPlayer())
{