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:
Kamron Batman 2020-09-06 12:41:17 -07:00 • committed by GitHub
parent 8b5c7c807f
commit c37c9991f7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 42 additions and 38 deletions

View file

@ -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)
{