From cebaa26a6916bc3ccbb0b8883f4a5fa5b12acdc9 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Tue, 20 Jun 2017 16:21:36 -0400 Subject: [PATCH] Fix crash from wrong data in aura field of creature_addon and creature_template_addon --- Game/Globals/ObjectManager.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Game/Globals/ObjectManager.cs b/Game/Globals/ObjectManager.cs index 499b6be7a..7171cc350 100644 --- a/Game/Globals/ObjectManager.cs +++ b/Game/Globals/ObjectManager.cs @@ -1836,7 +1836,10 @@ namespace Game byte i = 0; for (var c = 0; c < tokens.Length; ++c) { - uint spellId = uint.Parse(tokens[c].Replace(",", "")); + string id = tokens[c].Trim().Replace(",", ""); + if (!uint.TryParse(id, out uint spellId)) + continue; + SpellInfo AdditionalSpellInfo = Global.SpellMgr.GetSpellInfo(spellId); if (AdditionalSpellInfo == null) { @@ -1940,7 +1943,10 @@ namespace Game creatureAddon.auras = new uint[tokens.Length]; for (var c = 0; c < tokens.Length; ++c) { - uint spellId = uint.Parse(tokens[c]); + string id = tokens[c].Trim().Replace(",", ""); + if (!uint.TryParse(id, out uint spellId)) + continue; + SpellInfo AdditionalSpellInfo = Global.SpellMgr.GetSpellInfo(spellId); if (AdditionalSpellInfo == null) {