From cd01e14760458a6c09bb1ef7b162da46e217eaec Mon Sep 17 00:00:00 2001 From: B3none Date: Thu, 11 Jan 2024 19:27:44 +0000 Subject: [PATCH] Only allocate selected weapons for the !gun command during freeze period. --- RetakesAllocator/Helpers.cs | 5 +++++ RetakesAllocator/RetakesAllocator.cs | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/RetakesAllocator/Helpers.cs b/RetakesAllocator/Helpers.cs index fc01f2d..90b14ea 100644 --- a/RetakesAllocator/Helpers.cs +++ b/RetakesAllocator/Helpers.cs @@ -160,6 +160,11 @@ public static bool IsWarmup() { return GetGameRules().WarmupPeriod; } + + public static bool IsFreezeTime() + { + return GetGameRules().FreezePeriod; + } public static double GetVectorDistance(Vector v1, Vector v2) { diff --git a/RetakesAllocator/RetakesAllocator.cs b/RetakesAllocator/RetakesAllocator.cs index 3de731c..5389df4 100644 --- a/RetakesAllocator/RetakesAllocator.cs +++ b/RetakesAllocator/RetakesAllocator.cs @@ -100,7 +100,7 @@ out var selectedWeapon commandInfo.ReplyToCommand($"{MessagePrefix}{result}"); } - if (selectedWeapon is not null) + if (Helpers.IsFreezeTime() && selectedWeapon is not null) { var selectedWeaponRoundType = WeaponHelpers.GetRoundTypeForWeapon(selectedWeapon.Value); if (selectedWeaponRoundType == RoundType.Pistol || selectedWeaponRoundType == _currentRoundType)