From 40f8eb40484f96e41025320cc64c6637b23e908f Mon Sep 17 00:00:00 2001 From: zontreck Date: Mon, 10 Mar 2025 10:07:03 -0700 Subject: [PATCH] Attempt to fix a crash when no RTP checks are active that match the chunk generated/loaded. --- AriasServerUtils/RTPFactory.cs | 5 +++++ AriasServerUtils/modinfo.json | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/AriasServerUtils/RTPFactory.cs b/AriasServerUtils/RTPFactory.cs index 8155b8c..77d9fe0 100644 --- a/AriasServerUtils/RTPFactory.cs +++ b/AriasServerUtils/RTPFactory.cs @@ -154,6 +154,11 @@ public class RTPFactory internal static void ChunkLoaded(Vec2i chunkCoord, IWorldChunk[] chunks) { + // Check if this is even a valid check + var num = ChunkChecks.Where(x => x.ChunkX == chunkCoord.X && x.ChunkZ == chunkCoord.Y).Count(); + if (num == 0) return; + + // Get the chunk from the stack var chunk = ChunkChecks.Where(x => x.ChunkX == chunkCoord.X && x.ChunkZ == chunkCoord.Y).First(); diff --git a/AriasServerUtils/modinfo.json b/AriasServerUtils/modinfo.json index 23ebf07..1dd4911 100644 --- a/AriasServerUtils/modinfo.json +++ b/AriasServerUtils/modinfo.json @@ -3,8 +3,8 @@ "modid": "ariasserverutils", "name": "Aria's Server Utilities", "authors": ["zontreck"], - "description": "A collection of server utilities\n\nBuild Date: 03-10-2025 @ 10:01 AM MST", - "version": "1.0.6-dev.9", + "description": "A collection of server utilities\n\nBuild Date: 03-10-2025 @ 10:06 AM MST", + "version": "1.0.6-dev.10", "dependencies": { "game": "" }