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

@ -965,22 +965,17 @@ namespace Server.Engines.ConPVP
bool hadFlag = false;
Item[] flags = corpse.FindItemsByType(typeof(CTFFlag), false);
for (int i = 0; i < flags.Length; ++i)
(flags[i] as CTFFlag).DropTo(mob, killer);
hadFlag = hadFlag || flags.Length > 0;
if (mob.Backpack != null)
corpse.FindItemsByType<CTFFlag>(false).ForEach(flag =>
{
flags = mob.Backpack.FindItemsByType(typeof(CTFFlag), false);
hadFlag = true;
flag.DropTo(mob, killer);
});
for (int i = 0; i < flags.Length; ++i)
(flags[i] as CTFFlag).DropTo(mob, killer);
hadFlag = hadFlag || flags.Length > 0;
}
mob.Backpack?.FindItemsByType<CTFFlag>(false).ForEach(flag =>
{
hadFlag = true;
flag.DropTo(mob, killer);
});
if (killer != null && killer.Player)
{