Fixes several more expression issues and cast type check merges.
This commit is contained in:
parent
f93c3b992e
commit
9542c79ea4
24 changed files with 106 additions and 145 deletions
|
|
@ -242,7 +242,7 @@ namespace Server.Factions
|
|||
IPooledEnumerable<IEntity> eable = mob.Map.GetObjectsInRange(mob.Location, range, items, mobs);
|
||||
|
||||
foreach (IEntity obj in eable)
|
||||
if (type.IsAssignableFrom(obj.GetType()))
|
||||
if (type.IsInstanceOfType(obj))
|
||||
{
|
||||
eable.Free();
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Server.Commands;
|
||||
|
||||
namespace Server.Factions
|
||||
|
|
@ -68,11 +69,7 @@ namespace Server.Factions
|
|||
|
||||
private static bool CheckExistance(Point3D loc, Map facet, Type type)
|
||||
{
|
||||
foreach (Item item in facet.GetItemsInRange(loc, 0))
|
||||
if (type.IsAssignableFrom(item.GetType()))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
return facet.GetItemsInRange(loc, 0).Any(type.IsInstanceOfType);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -136,7 +136,7 @@ namespace Server.Engines.MLQuests.Objectives
|
|||
{
|
||||
Type destType = Objective.Destination;
|
||||
|
||||
return destType != null && destType.IsAssignableFrom(type);
|
||||
return destType?.IsAssignableFrom(type) == true;
|
||||
}
|
||||
|
||||
public override bool IsCompleted()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue