Fixes FindItemsByType and FindItemByType and new override of IsLockedDown and IsSecure by renaming their methods.

This commit is contained in:
Kamron Batman 2018-09-15 15:50:35 -07:00
parent 7321fa1b63
commit a48ebb3a5f
50 changed files with 416 additions and 643 deletions

View file

@ -168,25 +168,16 @@ namespace Server.Factions
public bool EquipWeapon()
{
Container pack = m_Guard.Backpack;
Item weapon = pack?.FindItemByType(typeof(BaseWeapon));
if (weapon == null)
return false;
return m_Guard.EquipItem(weapon);
Item weapon = m_Guard.Backpack?.FindItemByType<BaseWeapon>();
return weapon != null && m_Guard.EquipItem(weapon);
}
public bool StartBandage()
{
m_Bandage = null;
Container pack = m_Guard.Backpack;
Item bandage = pack?.FindItemByType(typeof(Bandage));
if (bandage == null)
if (m_Guard.Backpack?.FindItemByType<Bandage>() == null)
return false;
m_Bandage = BandageContext.BeginHeal(m_Guard, m_Guard);