fix: Stages faction code for serialization conversion (#1835)

This commit is contained in:
Kamron Batman 2024-06-16 11:53:15 -07:00 • committed by GitHub
parent 20596e52fa
commit 221312be4c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
43 changed files with 6234 additions and 6364 deletions

View file

@ -25,37 +25,17 @@ namespace Server.Factions
public static FactionItemDefinition Identify(Item item)
{
if (item is BaseArmor armor)
return item switch
{
if (CraftResources.GetType(armor.Resource) == CraftResourceType.Leather)
{
return m_LeatherArmor;
}
return m_MetalArmor;
}
if (item is BaseRanged)
{
return m_RangedWeapon;
}
if (item is BaseWeapon)
{
return m_Weapon;
}
if (item is BaseClothing)
{
return m_Clothing;
}
if (item is SpellScroll)
{
return m_Scroll;
}
return null;
BaseArmor armor => CraftResources.GetType(armor.Resource) == CraftResourceType.Leather
? m_LeatherArmor
: m_MetalArmor,
BaseRanged => m_RangedWeapon,
BaseWeapon => m_Weapon,
BaseClothing => m_Clothing,
SpellScroll => m_Scroll,
_ => null
};
}
}
}