Fixes loading into server/creating new character.
This commit is contained in:
@@ -51,7 +51,7 @@ namespace Framework.Database
|
|||||||
fileName = @"/sql/base/characters_database.sql";
|
fileName = @"/sql/base/characters_database.sql";
|
||||||
break;
|
break;
|
||||||
case "WorldDatabase":
|
case "WorldDatabase":
|
||||||
fileName = @"/sql/TDB_full_world_910.21081_2021_08_18";
|
fileName = @"/sql/TDB_full_world_910.21081_2021_08_18.sql";
|
||||||
break;
|
break;
|
||||||
case "HotfixDatabase":
|
case "HotfixDatabase":
|
||||||
fileName = @"/sql/TDB_full_hotfixes_910.21081_2021_08_18.sql";
|
fileName = @"/sql/TDB_full_hotfixes_910.21081_2021_08_18.sql";
|
||||||
|
|||||||
@@ -2705,7 +2705,12 @@ namespace Game.Spells
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach (Unit unit in units)
|
foreach (Unit unit in units)
|
||||||
|
{
|
||||||
|
if (!targets.ContainsKey(unit))
|
||||||
|
targets[unit] = 0;
|
||||||
|
|
||||||
targets[unit] |= 1u << (int)effect.EffectIndex;
|
targets[unit] |= 1u << (int)effect.EffectIndex;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2781,7 +2786,12 @@ namespace Game.Spells
|
|||||||
targetList.RemoveAll(unit => !unit.IsSelfOrInSameMap(GetDynobjOwner()));
|
targetList.RemoveAll(unit => !unit.IsSelfOrInSameMap(GetDynobjOwner()));
|
||||||
|
|
||||||
foreach (var unit in targetList)
|
foreach (var unit in targetList)
|
||||||
|
{
|
||||||
|
if (!targets.ContainsKey(unit))
|
||||||
|
targets[unit] = 0;
|
||||||
|
|
||||||
targets[unit] |= 1u << (int)effect.EffectIndex;
|
targets[unit] |= 1u << (int)effect.EffectIndex;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,19 +73,6 @@ namespace Game.Entities
|
|||||||
if (spellEffect == null)
|
if (spellEffect == null)
|
||||||
continue;
|
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))
|
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);
|
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)
|
public bool IsSpellValid(SpellInfo spellInfo, Player player = null, bool msg = true)
|
||||||
|
|||||||
Reference in New Issue
Block a user