Skip to content

Commit c15c860

Browse files
committed
Core/Spells: Implemented SummonPropertiesFlags::UseDemonTimeout
Closes TrinityCore#29930
1 parent 631c813 commit c15c860

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/server/game/DataStores/DBCEnums.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -2110,7 +2110,7 @@ enum class SummonPropertiesFlags : uint32
21102110
DespawnOnSummonerDeath = 0x00000008, // NYI
21112111
OnlyVisibleToSummoner = 0x00000010,
21122112
CannotDismissPet = 0x00000020, // NYI
2113-
UseDemonTimeout = 0x00000040, // NYI
2113+
UseDemonTimeout = 0x00000040,
21142114
UnlimitedSummons = 0x00000080, // NYI
21152115
UseCreatureLevel = 0x00000100,
21162116
JoinSummonerSpawnGroup = 0x00000200, // NYI

src/server/game/Entities/Creature/TemporarySummon.cpp

+8-1
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,14 @@ void TempSummon::InitStats(WorldObject* summoner, Milliseconds duration)
193193
m_lifetime = duration;
194194

195195
if (m_type == TEMPSUMMON_MANUAL_DESPAWN)
196-
m_type = (duration <= 0ms) ? TEMPSUMMON_DEAD_DESPAWN : TEMPSUMMON_TIMED_DESPAWN;
196+
{
197+
if (duration <= 0s)
198+
m_type = TEMPSUMMON_DEAD_DESPAWN;
199+
else if (m_Properties && m_Properties->GetFlags().HasFlag(SummonPropertiesFlags::UseDemonTimeout))
200+
m_type = TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT;
201+
else
202+
m_type = TEMPSUMMON_TIMED_DESPAWN;
203+
}
197204

198205
if (summoner && summoner->IsPlayer())
199206
{

0 commit comments

Comments
 (0)