From 0eaf9bb352b0198d75f0cc5a2e5c37baaa819baa Mon Sep 17 00:00:00 2001 From: Yoni Lerner Date: Wed, 3 Apr 2024 23:33:59 -0700 Subject: [PATCH] Allow pickups --- RetakesAllocator/RetakesAllocator.cs | 11 +++++++---- RetakesAllocatorCore/Config/Configs.cs | 2 +- RetakesAllocatorCore/PluginInfo.cs | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/RetakesAllocator/RetakesAllocator.cs b/RetakesAllocator/RetakesAllocator.cs index 948d151..2d83e05 100644 --- a/RetakesAllocator/RetakesAllocator.cs +++ b/RetakesAllocator/RetakesAllocator.cs @@ -315,6 +315,12 @@ public HookResult OnWeaponCanAcquire(DynamicHook hook) return HookResult.Continue; } + var acquireMethod = hook.GetParam(2); + if (acquireMethod == AcquireMethod.PickUp) + { + return HookResult.Continue; + } + if (Helpers.IsWarmup()) { return HookResult.Continue; @@ -329,7 +335,6 @@ public HookResult OnWeaponCanAcquire(DynamicHook hook) HookResult RetStop() { - var acquireMethod = hook.GetParam(2); // Log.Debug($"Exiting OnWeaponCanAcquire {acquireMethod}"); hook.SetReturn( acquireMethod != AcquireMethod.PickUp @@ -584,9 +589,7 @@ out var currentRoundType var roundType = RoundTypeManager.Instance.GetCurrentRoundType()!.Value; var roundTypeName = RoundTypeHelpers.TranslateRoundTypeName(roundType); var message = Translator.Instance["announcement.roundtype", roundTypeName]; - Server.PrintToChatAll( - $"{MessagePrefix}{message}" - ); + Server.PrintToChatAll($"{MessagePrefix}{message}"); if (Configs.GetConfigData().EnableRoundTypeAnnouncementCenter) { foreach (var player in allPlayers) diff --git a/RetakesAllocatorCore/Config/Configs.cs b/RetakesAllocatorCore/Config/Configs.cs index 9f5778c..9c10169 100644 --- a/RetakesAllocatorCore/Config/Configs.cs +++ b/RetakesAllocatorCore/Config/Configs.cs @@ -214,7 +214,7 @@ public Dictionary< public bool ResetStateOnGameRestart { get; set; } = true; public bool AllowAllocationAfterFreezeTime { get; set; } = true; public bool EnableRoundTypeAnnouncement { get; set; } = true; - public bool EnableRoundTypeAnnouncementCenter { get; set; } = true; + public bool EnableRoundTypeAnnouncementCenter { get; set; } = false; public bool EnableNextRoundTypeVoting { get; set; } = false; public int NumberOfExtraVipChancesForPreferredWeapon { get; set; } = 1; public bool AllowPreferredWeaponForEveryone { get; set; } = false; diff --git a/RetakesAllocatorCore/PluginInfo.cs b/RetakesAllocatorCore/PluginInfo.cs index 0082f8e..672b917 100644 --- a/RetakesAllocatorCore/PluginInfo.cs +++ b/RetakesAllocatorCore/PluginInfo.cs @@ -5,7 +5,7 @@ namespace RetakesAllocatorCore; public static class PluginInfo { - public const string Version = "2.3.1"; + public const string Version = "2.3.2"; public static readonly string LogPrefix = $"[RetakesAllocator {Version}] ";