Fixes weapon ability and spell registry (#229)
- [X] Fixes NPE from weapon ability - [X] Updates [cast so it is not case sensitive, and you don't need the word "Spell" at the end. Bumps release
This commit is contained in:
parent
8b5c7c807f
commit
c37c9991f7
2 changed files with 42 additions and 38 deletions
|
|
@ -126,7 +126,7 @@ namespace Server.Spells
|
|||
{
|
||||
return (Spell)ActivatorUtil.CreateInstance(t, m_Params);
|
||||
}
|
||||
catch
|
||||
catch (Exception e)
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
|
|
@ -137,9 +137,13 @@ namespace Server.Spells
|
|||
|
||||
public static Spell NewSpell(string name, Mobile caster, Item scroll)
|
||||
{
|
||||
name = name.Replace(" ", "");
|
||||
|
||||
for (var i = 0; i < m_CircleNames.Length; ++i)
|
||||
{
|
||||
var t = AssemblyHandler.FindFirstTypeForName($"Server.Spells.{m_CircleNames[i]}.{name}");
|
||||
var t =
|
||||
AssemblyHandler.FindFirstTypeForName($"Server.Spells.{m_CircleNames[i]}.{name}", true) ??
|
||||
AssemblyHandler.FindFirstTypeForName($"Server.Spells.{m_CircleNames[i]}.{name}Spell", true);
|
||||
|
||||
if (t?.IsSubclassOf(typeof(SpecialMove)) == false)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue