Fixes loading into server/creating new character.

This commit is contained in:
hondacrx
2021-08-31 13:20:06 -04:00
parent 4e03358392
commit cdd34e644a
3 changed files with 17 additions and 14 deletions
+6 -13
View File
@@ -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)