From a8201c93b0bfe775a07670c16ba97a6e5cd31851 Mon Sep 17 00:00:00 2001 From: Bohica <53943479+Bohicatv@users.noreply.github.com> Date: Wed, 2 Jul 2025 23:52:26 -0700 Subject: [PATCH] crash fix --- Projects/UOContent/Spells/Base/MagerySpell.cs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/Projects/UOContent/Spells/Base/MagerySpell.cs b/Projects/UOContent/Spells/Base/MagerySpell.cs index f38f01210..5766f7113 100644 --- a/Projects/UOContent/Spells/Base/MagerySpell.cs +++ b/Projects/UOContent/Spells/Base/MagerySpell.cs @@ -109,14 +109,30 @@ namespace Server.Spells return base.GetCastDelay(); } + public class MagerySpellConfig + { + public int[] ManaPerCircle { get; set; } + public double[] SkillTable { get; set; } + public double[] SkillTableML { get; set; } + public double? SkillCheckWindow { get; set; } + public double? CastDelay { get; set; } + } + private const string _configPath = "Data/magery-spell.json"; public static void Configure() { var path = Path.Combine(Core.BaseDirectory, _configPath); + if (File.Exists(path)) { - JsonConfig.Deserialize(path); + var config = JsonConfig.Deserialize(path); + + if (config.ManaPerCircle != null) { ManaPerCircle = config.ManaPerCircle; } + if (config.SkillTable != null) { SkillTable = config.SkillTable; } + if (config.SkillTableML != null) { SkillTableML = config.SkillTableML; } + if (config.SkillCheckWindow.HasValue) { SkillCheckWindow = config.SkillCheckWindow.Value; } + if (config.CastDelay.HasValue) { CastDelay = config.CastDelay.Value; } } } }