From 06443ba0ca19d4f509cbca4c2a6cb04e5b04ab03 Mon Sep 17 00:00:00 2001 From: Kamron Batman <3953314+kamronbatman@users.noreply.github.com> Date: Fri, 28 Nov 2025 11:01:20 -0800 Subject: [PATCH] fix: Cleans up the GetXDistance methods. (#2279) --- Projects/Server/Maps/Map.ClientByDistanceEnumerator.cs | 6 +----- Projects/Server/Maps/Map.ItemByDistanceEnumerator.cs | 4 ++-- Projects/Server/Maps/Map.MobileByDistanceEnumerator.cs | 4 ++-- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/Projects/Server/Maps/Map.ClientByDistanceEnumerator.cs b/Projects/Server/Maps/Map.ClientByDistanceEnumerator.cs index 6d324cbb3..18a443c61 100644 --- a/Projects/Server/Maps/Map.ClientByDistanceEnumerator.cs +++ b/Projects/Server/Maps/Map.ClientByDistanceEnumerator.cs @@ -50,11 +50,7 @@ public partial class Map } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public ClientDistanceEnumerable GetClientsInBoundsByDistance(Rectangle2D bounds) => - GetClientsInBoundsByDistance(bounds, new Point2D(bounds.X + bounds.Width / 2, bounds.Y + bounds.Height / 2)); - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public ClientDistanceEnumerable GetClientsInBoundsByDistance(Rectangle2D bounds, bool makeBoundsInclusive) => + public ClientDistanceEnumerable GetClientsInBoundsByDistance(Rectangle2D bounds, bool makeBoundsInclusive = false) => GetClientsInBoundsByDistance(bounds, new Point2D(bounds.X + bounds.Width / 2, bounds.Y + bounds.Height / 2), makeBoundsInclusive); [MethodImpl(MethodImplOptions.AggressiveInlining)] diff --git a/Projects/Server/Maps/Map.ItemByDistanceEnumerator.cs b/Projects/Server/Maps/Map.ItemByDistanceEnumerator.cs index 698fe8b89..dd022e0c1 100644 --- a/Projects/Server/Maps/Map.ItemByDistanceEnumerator.cs +++ b/Projects/Server/Maps/Map.ItemByDistanceEnumerator.cs @@ -69,8 +69,8 @@ public partial class Map } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public ItemDistanceEnumerable GetItemsInBoundsByDistance(Rectangle2D bounds) => - GetItemsInBoundsByDistance(bounds); + public ItemDistanceEnumerable GetItemsInBoundsByDistance(Rectangle2D bounds, bool makeBoundsInclusive = false) => + GetItemsInBoundsByDistance(bounds, makeBoundsInclusive); [MethodImpl(MethodImplOptions.AggressiveInlining)] public ItemDistanceEnumerable GetItemsInBoundsByDistance(Rectangle2D bounds, bool makeBoundsInclusive = false) diff --git a/Projects/Server/Maps/Map.MobileByDistanceEnumerator.cs b/Projects/Server/Maps/Map.MobileByDistanceEnumerator.cs index a8d42c693..d508cd8d0 100644 --- a/Projects/Server/Maps/Map.MobileByDistanceEnumerator.cs +++ b/Projects/Server/Maps/Map.MobileByDistanceEnumerator.cs @@ -69,8 +69,8 @@ public partial class Map } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public MobileDistanceEnumerable GetMobilesInBoundsByDistance(Rectangle2D bounds) => - GetMobilesInBoundsByDistance(bounds); + public MobileDistanceEnumerable GetMobilesInBoundsByDistance(Rectangle2D bounds, bool makeBoundsInclusive = false) => + GetMobilesInBoundsByDistance(bounds, makeBoundsInclusive); [MethodImpl(MethodImplOptions.AggressiveInlining)] public MobileDistanceEnumerable GetMobilesInBoundsByDistance(Rectangle2D bounds, bool makeBoundsInclusive = false) where T : Mobile =>