From 5dac6b2825973e7a52f356acb5a12de8e0953b74 Mon Sep 17 00:00:00 2001 From: VinPropane Date: Sun, 24 May 2026 15:21:37 -0400 Subject: [PATCH] NEO-61: fix null snapshot on depletion deny path. Check TryGetRemainingGathers return before using the out snapshot; default struct had null InteractableId and threw on .Length. --- .../Game/Gathering/ResourceNodeInstanceOperations.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/server/NeonSprawl.Server/Game/Gathering/ResourceNodeInstanceOperations.cs b/server/NeonSprawl.Server/Game/Gathering/ResourceNodeInstanceOperations.cs index 2186d45..e9f89a7 100644 --- a/server/NeonSprawl.Server/Game/Gathering/ResourceNodeInstanceOperations.cs +++ b/server/NeonSprawl.Server/Game/Gathering/ResourceNodeInstanceOperations.cs @@ -38,10 +38,14 @@ public static class ResourceNodeInstanceOperations new ResourceNodeInstanceSnapshot(key, remaining)); } - store.TryGetRemainingGathers(key, out var current); + if (!store.TryGetRemainingGathers(key, out var current)) + { + current = new ResourceNodeInstanceSnapshot(key, 0); + } + return new ResourceNodeInstanceMutationOutcome( ResourceNodeInstanceMutationKind.Denied, ResourceNodeInstanceReasonCodes.NodeDepleted, - current.InteractableId.Length > 0 ? current : new ResourceNodeInstanceSnapshot(key, 0)); + current); } }