From db2a242d8e8cfc20a130ffaec0ea7d616fcd3076 Mon Sep 17 00:00:00 2001 From: Kurt Date: Sun, 25 Jan 2026 03:00:46 -0600 Subject: [PATCH] Update LayerPositionConfig.cs --- .../Map/Layers/LayerPositionConfig.cs | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/NHSE.Core/Structures/Map/Layers/LayerPositionConfig.cs b/NHSE.Core/Structures/Map/Layers/LayerPositionConfig.cs index ddc9aa6..3dda6bd 100644 --- a/NHSE.Core/Structures/Map/Layers/LayerPositionConfig.cs +++ b/NHSE.Core/Structures/Map/Layers/LayerPositionConfig.cs @@ -85,19 +85,11 @@ namespace NHSE.Core; /// if the coordinates are valid; otherwise, . public bool IsCoordinateValidRelative(int relX, int relY) { - var index = GetIndexTileRelative(relX, relY); - return (uint)index < (CountWidth * CountHeight << (TileBitShift * 2)); - } - - /// - /// Gets the requested tile index within the layer, given relative tile coordinates. - /// - /// The tile index within the layer. - public int GetIndexTileRelative(int relX, int relY) - { - // Tile ordering is top-down, left-to-right. - // In other words, Item[1] is X=0,Y=1 - return (relX * (CountHeight << TileBitShift)) + relY; + if ((uint)relX >= CountWidth << TileBitShift) + return false; + if ((uint)relY >= CountHeight << TileBitShift) + return false; + return true; } public bool IsCoordinateValidAbsolute(int absX, int absY)