From c58fa1ec7a69302558c472790ac2ffabf7d4ce42 Mon Sep 17 00:00:00 2001 From: Chomp Date: Sat, 1 Feb 2025 20:31:26 +0000 Subject: [PATCH] Updated `GetBot` to pop last item off instead of first Updated `GetX` to expect an IList --- Libraries/Core/Services/BotGenerationCacheService.cs | 4 ++-- SptCommon/Extensions/ListExtensions.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Libraries/Core/Services/BotGenerationCacheService.cs b/Libraries/Core/Services/BotGenerationCacheService.cs index 9f1b8a67..dc62c01d 100644 --- a/Libraries/Core/Services/BotGenerationCacheService.cs +++ b/Libraries/Core/Services/BotGenerationCacheService.cs @@ -1,4 +1,4 @@ -using SptCommon.Annotations; +using SptCommon.Annotations; using Core.Models.Eft.Common.Tables; using Core.Models.Utils; using SptCommon.Extensions; @@ -50,7 +50,7 @@ public class BotGenerationCacheService( { try { - return bots.PopFirst(); + return bots.PopLast(); } catch (Exception _) { diff --git a/SptCommon/Extensions/ListExtensions.cs b/SptCommon/Extensions/ListExtensions.cs index 98fb31da..a3d34c27 100644 --- a/SptCommon/Extensions/ListExtensions.cs +++ b/SptCommon/Extensions/ListExtensions.cs @@ -9,14 +9,14 @@ public static class ListExtensions return items; } - public static T PopFirst(this List source) + public static T PopFirst(this IList source) { T r = source.First(); source.Remove(source.First()); return r; } - public static T PopLast(this List source) + public static T PopLast(this IList source) { T r = source.Last(); source.Remove(source.Last());