diff options
author | Meji <alvaro.megias@outlook.com> | 2024-05-19 13:38:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-19 13:38:21 +0200 |
commit | 5f6bc9ff5feb090a2ca8a7c0aea79ee14099b454 (patch) | |
tree | 7e24d4fca75d3e91f1db18c0d7538f3281aa6c43 /src | |
parent | 36a434800efb3e364353d20d1593c6bb0ce4e46f (diff) |
Core/Creatures: Fix level scaling for summons without SummonPropertiesFlags::UseCreatureLevel (#29958)
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Entities/Creature/TemporarySummon.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/server/game/Entities/Creature/TemporarySummon.cpp b/src/server/game/Entities/Creature/TemporarySummon.cpp index 95a7f9c19ff..2d969baf261 100644 --- a/src/server/game/Entities/Creature/TemporarySummon.cpp +++ b/src/server/game/Entities/Creature/TemporarySummon.cpp @@ -239,7 +239,12 @@ void TempSummon::InitStats(WorldObject* summoner, Milliseconds duration) } if (!m_Properties->GetFlags().HasFlag(SummonPropertiesFlags::UseCreatureLevel)) - SetLevel(unitSummoner->GetLevel()); + { + int32 minLevel = m_unitData->ScalingLevelMin + m_unitData->ScalingLevelDelta; + int32 maxLevel = m_unitData->ScalingLevelMax + m_unitData->ScalingLevelDelta; + uint8 level = std::clamp<int32>(unitSummoner->GetLevel(), minLevel, maxLevel); + SetLevel(level); + } } uint32 faction = m_Properties->Faction; |