fix: Removes LINQ from Map.cs (#834)
* Removes LINQ from Map * Removes broken GetObjectsInRange with items/mobile flags.
This commit is contained in:
parent
5019ce9694
commit
284c3d0f34
6 changed files with 833 additions and 87 deletions
|
|
@ -43,13 +43,18 @@ namespace Server.Commands.Generic
|
|||
return;
|
||||
}
|
||||
|
||||
var eable = map.GetObjectsInBounds(rect, items, mobiles);
|
||||
var eable = map.GetObjectsInBounds(rect);
|
||||
|
||||
var objs = new List<object>();
|
||||
|
||||
foreach (var obj in eable)
|
||||
{
|
||||
if ((!mobiles || obj is not Mobile || BaseCommand.IsAccessible(from, obj)) && ext.IsValid(obj))
|
||||
if (!mobiles && obj is Mobile || !items && obj is Item)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (BaseCommand.IsAccessible(from, obj) && ext.IsValid(obj))
|
||||
{
|
||||
objs.Add(obj);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -273,9 +273,14 @@ namespace Server.Factions
|
|||
return false;
|
||||
}
|
||||
|
||||
var eable = mob.Map.GetObjectsInRange(mob.Location, range, items, mobs);
|
||||
var eable = mob.Map.GetObjectsInRange(mob.Location, range);
|
||||
foreach (var obj in eable)
|
||||
{
|
||||
if (!mobs && obj is Mobile || !items && obj is Item)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (type.IsInstanceOfType(obj))
|
||||
{
|
||||
eable.Free();
|
||||
|
|
|
|||
|
|
@ -215,7 +215,7 @@ namespace Server.Items
|
|||
alchemyBonus = (int)(from.Skills.Alchemy.Value / (Core.AOS ? 5 : 10));
|
||||
}
|
||||
|
||||
var eable = map.GetObjectsInRange(loc, ExplosionRange, LeveledExplosion);
|
||||
var eable = map.GetObjectsInRange(loc, ExplosionRange);
|
||||
using var queue = PooledRefQueue<IEntity>.Create();
|
||||
|
||||
var toDamage = 0;
|
||||
|
|
@ -234,7 +234,7 @@ namespace Server.Items
|
|||
queue.Enqueue(entity);
|
||||
}
|
||||
}
|
||||
else if (entity is BaseExplosionPotion)
|
||||
else if (LeveledExplosion && entity is BaseExplosionPotion)
|
||||
{
|
||||
queue.Enqueue(entity);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue