fix(types): Fixes casting spell by type and [Add keyword search (#668)

* Fixes `[cast`
* Fixes `[add` search
This commit is contained in:
Kamron Batman 2021-08-01 13:18:01 -07:00 • committed by GitHub
parent 4bad733366
commit ebac984543
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 44 additions and 19 deletions

View file

@ -156,9 +156,9 @@ namespace Server.Spells
for (var i = 0; i < m_CircleNames.Length; ++i)
{
var t =
AssemblyHandler.FindTypeByName($"Server.Spells.{m_CircleNames[i]}.{name}") ??
AssemblyHandler.FindTypeByName($"Server.Spells.{m_CircleNames[i]}.{name}Spell");
var t = name.InsensitiveEndsWith("spell") ?
AssemblyHandler.FindTypeByFullName($"Server.Spells.{m_CircleNames[i]}.{name}") :
AssemblyHandler.FindTypeByFullName($"Server.Spells.{m_CircleNames[i]}.{name}Spell");
if (t?.IsSubclassOf(typeof(SpecialMove)) == false)
{