fix: Removes GetObjectsInRange and fixes boat planks closing (#1579)
## BREAKING CHANGE - Deletes `map.GetObjectsInRange` and `map.GetObejctsInBounds` ### Notes Developers are expected to enumerate mobiles and items separately now using `map.GetMobilesInRange` and `map.GetItemsInRange`. This helps keep the code streamlined so we don't have to maintain multiple copies of ref struct enumerators that do the same thing. ### Fixes - [X] Fixes bug with planks closing - [X] Fixes issue with iterating items/mobiles from a null map
This commit is contained in:
parent
cb1638591b
commit
977fdc2c5a
21 changed files with 543 additions and 461 deletions
|
|
@ -43,22 +43,29 @@ namespace Server.Commands.Generic
|
|||
return;
|
||||
}
|
||||
|
||||
var eable = map.GetObjectsInBounds(rect);
|
||||
|
||||
var objs = new List<object>();
|
||||
|
||||
foreach (var obj in eable)
|
||||
if (mobiles)
|
||||
{
|
||||
if (!mobiles && obj is Mobile || !items && obj is Item)
|
||||
foreach (var m in map.GetMobilesInBounds(rect))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (BaseCommand.IsAccessible(from, obj) && ext.IsValid(obj))
|
||||
{
|
||||
objs.Add(obj);
|
||||
if (BaseCommand.IsAccessible(from, m) && ext.IsValid(m))
|
||||
{
|
||||
objs.Add(m);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (items)
|
||||
{
|
||||
foreach (var item in map.GetItemsInBounds(rect))
|
||||
{
|
||||
if (BaseCommand.IsAccessible(from, item) && ext.IsValid(item))
|
||||
{
|
||||
objs.Add(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ext.Filter(objs);
|
||||
|
||||
RunCommand(from, objs, command, args);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue