From cdd34e644afd6b32652f177b030cd6196b3c0a30 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Tue, 31 Aug 2021 13:20:06 -0400 Subject: [PATCH] Fixes loading into server/creating new character. --- Source/Framework/Database/DatabaseUpdater.cs | 2 +- Source/Game/Spells/Auras/Aura.cs | 10 ++++++++++ Source/Game/Spells/SpellManager.cs | 19 ++++++------------- 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/Source/Framework/Database/DatabaseUpdater.cs b/Source/Framework/Database/DatabaseUpdater.cs index 80c0db097..27231fd56 100644 --- a/Source/Framework/Database/DatabaseUpdater.cs +++ b/Source/Framework/Database/DatabaseUpdater.cs @@ -51,7 +51,7 @@ namespace Framework.Database fileName = @"/sql/base/characters_database.sql"; break; case "WorldDatabase": - fileName = @"/sql/TDB_full_world_910.21081_2021_08_18"; + fileName = @"/sql/TDB_full_world_910.21081_2021_08_18.sql"; break; case "HotfixDatabase": fileName = @"/sql/TDB_full_hotfixes_910.21081_2021_08_18.sql"; diff --git a/Source/Game/Spells/Auras/Aura.cs b/Source/Game/Spells/Auras/Aura.cs index 46c95dd75..59b01ed86 100644 --- a/Source/Game/Spells/Auras/Aura.cs +++ b/Source/Game/Spells/Auras/Aura.cs @@ -2705,7 +2705,12 @@ namespace Game.Spells } foreach (Unit unit in units) + { + if (!targets.ContainsKey(unit)) + targets[unit] = 0; + targets[unit] |= 1u << (int)effect.EffectIndex; + } } } @@ -2781,7 +2786,12 @@ namespace Game.Spells targetList.RemoveAll(unit => !unit.IsSelfOrInSameMap(GetDynobjOwner())); foreach (var unit in targetList) + { + if (!targets.ContainsKey(unit)) + targets[unit] = 0; + targets[unit] |= 1u << (int)effect.EffectIndex; + } } } } diff --git a/Source/Game/Spells/SpellManager.cs b/Source/Game/Spells/SpellManager.cs index 9d997cf23..d9d35dd69 100644 --- a/Source/Game/Spells/SpellManager.cs +++ b/Source/Game/Spells/SpellManager.cs @@ -73,19 +73,6 @@ namespace Game.Entities if (spellEffect == null) continue; - var parameters = methodInfo.GetParameters(); - if (parameters.Length < 1) - { - Log.outError(LogFilter.ServerLoading, "Method: {0} has wrong parameter count: {1} Should be 1. Can't load SpellEffect.", methodInfo.Name, parameters.Length); - continue; - } - - if (parameters[0].ParameterType != typeof(uint)) - { - Log.outError(LogFilter.ServerLoading, "Method: {0} has wrong parameter Types: ({1}) Should be (uint). Can't load SpellEffect.", methodInfo.Name, parameters[0].ParameterType); - continue; - } - if (SpellEffectsHandlers.ContainsKey(spellEffect.EffectName)) { Log.outError(LogFilter.ServerLoading, "Tried to override SpellEffectsHandler of {0} with {1} (EffectName {2}).", SpellEffectsHandlers[spellEffect.EffectName].ToString(), methodInfo.Name, spellEffect.EffectName); @@ -96,6 +83,12 @@ namespace Game.Entities } } } + + if (SpellEffectsHandlers.Count == 0) + { + Log.outFatal(LogFilter.ServerLoading, "Could'nt find any SpellEffectHandlers. Dev needs to check this out."); + Global.WorldMgr.ShutdownServ(0, ShutdownMask.Force, ShutdownExitCode.Error); + } } public bool IsSpellValid(SpellInfo spellInfo, Player player = null, bool msg = true)