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

@ -71,13 +71,10 @@ namespace Server.SkillHandlers
from.SendLocalizedMessage(502372); // You fail to disarm the trap... but you don't set it off
}
}
else if (targeted is BaseFactionTrap)
else if (targeted is BaseFactionTrap trap)
{
BaseFactionTrap trap = (BaseFactionTrap)targeted;
Faction faction = Faction.Find(from);
FactionTrapRemovalKit kit =
from.Backpack?.FindItemByType(typeof(FactionTrapRemovalKit)) as FactionTrapRemovalKit;
FactionTrapRemovalKit kit = from.Backpack?.FindItemByType<FactionTrapRemovalKit>();
bool isOwner = trap.Placer == from || trap.Faction != null && trap.Faction.IsCommander(from);
@ -121,12 +118,12 @@ namespace Server.SkillHandlers
}
if (!isOwner)
kit?.ConsumeCharge(from);
kit.ConsumeCharge(from);
}
}
else
{
from.SendLocalizedMessage(502373); // That does'nt appear to be trapped
from.SendLocalizedMessage(502373); // That doesn't appear to be trapped
}
}
}