Core/Spells: Replaced assert with startup error log

Port From (https://github.com/TrinityCore/TrinityCore/commit/8043b71708e2efd380c7a1f6a738a1e9e497706d)
This commit is contained in:
Hondacrx
2024-08-26 00:03:26 -04:00
parent 800bf056ee
commit e4e660c995
3 changed files with 27 additions and 0 deletions
+2
View File
@@ -2222,6 +2222,8 @@ namespace Game.Entities
case AuraType.AddPctModifierBySpellLabel:
case AuraType.AddFlatModifierBySpellLabel:
Cypher.Assert(effect.EffectMiscValue[0] < (int)SpellModOp.Max, $"MAX_SPELLMOD must be at least {effect.EffectMiscValue[0] + 1}");
if (effect.EffectMiscValue[0] >= (int)SpellModOp.Max)
Log.outError(LogFilter.ServerLoading, $"Invalid spell modifier type {effect.EffectMiscValue[0]} found on spell {effect.SpellID} effect index {effect.EffectIndex}, consider increasing MAX_SPELLMOD");
break;
default:
break;