fix: Fixes null enumerable compile erorr (#1549)
This commit is contained in:
parent
d57f1fecc1
commit
e2f5728258
4 changed files with 10 additions and 10 deletions
|
|
@ -2469,7 +2469,7 @@ public class Item : IHued, IComparable<Item>, ISpawnable, IObjectPropertyListEnt
|
|||
var map = m_Map;
|
||||
|
||||
return map == null
|
||||
? Map.NullEnumerable<IEntity>.Instance
|
||||
? PooledEnumeration.NullEnumerable<IEntity>.Instance
|
||||
: map.GetObjectsInRange(m_Parent == null ? m_Location : GetWorldLocation(), range);
|
||||
}
|
||||
|
||||
|
|
@ -2478,7 +2478,7 @@ public class Item : IHued, IComparable<Item>, ISpawnable, IObjectPropertyListEnt
|
|||
var map = m_Map;
|
||||
|
||||
return map?.GetItemsInRange(m_Parent == null ? m_Location : GetWorldLocation(), range)
|
||||
?? Map.NullEnumerable<Item>.Instance;
|
||||
?? PooledEnumeration.NullEnumerable<Item>.Instance;
|
||||
}
|
||||
|
||||
public IPooledEnumerable<Mobile> GetMobilesInRange(int range)
|
||||
|
|
@ -2486,7 +2486,7 @@ public class Item : IHued, IComparable<Item>, ISpawnable, IObjectPropertyListEnt
|
|||
var map = m_Map;
|
||||
|
||||
return map?.GetMobilesInRange(m_Parent == null ? m_Location : GetWorldLocation(), range)
|
||||
?? Map.NullEnumerable<Mobile>.Instance;
|
||||
?? PooledEnumeration.NullEnumerable<Mobile>.Instance;
|
||||
}
|
||||
|
||||
public IPooledEnumerable<NetState> GetClientsInRange(int range)
|
||||
|
|
@ -2494,7 +2494,7 @@ public class Item : IHued, IComparable<Item>, ISpawnable, IObjectPropertyListEnt
|
|||
var map = m_Map;
|
||||
|
||||
return map.GetClientsInRange(m_Parent == null ? m_Location : GetWorldLocation(), range)
|
||||
?? Map.NullEnumerable<NetState>.Instance;
|
||||
?? PooledEnumeration.NullEnumerable<NetState>.Instance;
|
||||
}
|
||||
|
||||
public bool GetTempFlag(int flag) => ((LookupCompactInfo()?.m_TempFlags ?? 0) & flag) != 0;
|
||||
|
|
|
|||
|
|
@ -8067,18 +8067,18 @@ public partial class Mobile : IHued, IComparable<Mobile>, ISpawnable, IObjectPro
|
|||
public IPooledEnumerable<Item> GetItemsInRange(int range) => GetItemsInRange<Item>(range);
|
||||
|
||||
public IPooledEnumerable<T> GetItemsInRange<T>(int range) where T : Item =>
|
||||
m_Map?.GetItemsInRange<T>(m_Location, range) ?? Map.NullEnumerable<T>.Instance;
|
||||
m_Map?.GetItemsInRange<T>(m_Location, range) ?? PooledEnumeration.NullEnumerable<T>.Instance;
|
||||
|
||||
public IPooledEnumerable<IEntity> GetObjectsInRange(int range) =>
|
||||
m_Map?.GetObjectsInRange(m_Location, range) ?? Map.NullEnumerable<IEntity>.Instance;
|
||||
m_Map?.GetObjectsInRange(m_Location, range) ?? PooledEnumeration.NullEnumerable<IEntity>.Instance;
|
||||
|
||||
public IPooledEnumerable<Mobile> GetMobilesInRange(int range) => GetMobilesInRange<Mobile>(range);
|
||||
|
||||
public IPooledEnumerable<T> GetMobilesInRange<T>(int range) where T : Mobile =>
|
||||
m_Map?.GetMobilesInRange<T>(m_Location, range) ?? Map.NullEnumerable<T>.Instance;
|
||||
m_Map?.GetMobilesInRange<T>(m_Location, range) ?? PooledEnumeration.NullEnumerable<T>.Instance;
|
||||
|
||||
public IPooledEnumerable<NetState> GetClientsInRange(int range) =>
|
||||
m_Map?.GetClientsInRange(m_Location, range) ?? Map.NullEnumerable<NetState>.Instance;
|
||||
m_Map?.GetClientsInRange(m_Location, range) ?? PooledEnumeration.NullEnumerable<NetState>.Instance;
|
||||
|
||||
public void SayTo(Mobile to, bool ascii, string text) =>
|
||||
PrivateOverheadMessage(MessageType.Regular, SpeechHue, ascii, text, to.NetState);
|
||||
|
|
|
|||
|
|
@ -244,7 +244,7 @@ public class TileMatrix
|
|||
{
|
||||
var eable = _map.GetMultiTilesAt(x, y);
|
||||
|
||||
if (eable == Map.NullEnumerable<StaticTile[]>.Instance)
|
||||
if (eable == PooledEnumeration.NullEnumerable<StaticTile[]>.Instance)
|
||||
{
|
||||
return tiles[x & 0x7][y & 0x7];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ public class BoatPacketTests : IClassFixture<ServerFixture>
|
|||
public override bool Contains(int x, int y) => !_notContainedList.Any(e => e.X == x && e.Y == y);
|
||||
|
||||
public override MovingEntitiesEnumerable GetMovingEntities(bool includeBoat = false) =>
|
||||
new(this, true, new Map.PooledEnumerable<IEntity>(_list));
|
||||
new(this, true, new PooledEnumeration.PooledEnumerable<IEntity>(_list));
|
||||
}
|
||||
|
||||
private class MockedMobile : Mobile
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue