Fixes FindItemsByType and FindItemByType and new override of IsLockedDown and IsSecure by renaming their methods.
This commit is contained in:
parent
7321fa1b63
commit
a48ebb3a5f
50 changed files with 416 additions and 643 deletions
|
|
@ -1,5 +1,6 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Server.Engines.Quests;
|
||||
using Server.Engines.Quests.Collector;
|
||||
using Server.Items;
|
||||
|
|
@ -198,22 +199,9 @@ namespace Server.Engines.Harvest
|
|||
|
||||
public override bool CheckResources(Mobile from, Item tool, HarvestDefinition def, Map map, Point3D loc, bool timed)
|
||||
{
|
||||
Container pack = from.Backpack;
|
||||
|
||||
if (pack != null)
|
||||
{
|
||||
List<SOS> messages = pack.FindItemsByType<SOS>();
|
||||
|
||||
for (int i = 0; i < messages.Count; ++i)
|
||||
{
|
||||
SOS sos = messages[i];
|
||||
|
||||
if ((from.Map == Map.Felucca || from.Map == Map.Trammel) && from.InRange(sos.TargetLocation, 60))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return base.CheckResources(from, tool, def, map, loc, timed);
|
||||
return from?.Backpack?.FindItemsByType<SOS>().Any(sos =>
|
||||
(from.Map == Map.Felucca || from.Map == Map.Trammel) && from.InRange(sos.TargetLocation, 60)) ??
|
||||
base.CheckResources(from, tool, def, map, loc, timed);
|
||||
}
|
||||
|
||||
public override Item Construct(Type type, Mobile from)
|
||||
|
|
@ -320,9 +308,7 @@ namespace Server.Engines.Harvest
|
|||
|
||||
if (preLoot != null)
|
||||
{
|
||||
if (preLoot is IShipwreckedItem shipwreckedItem)
|
||||
shipwreckedItem.IsShipwreckedItem = true;
|
||||
|
||||
((IShipwreckedItem)preLoot).IsShipwreckedItem = true;
|
||||
return preLoot;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue