Skip to content

Commit

Permalink
Only allocate selected weapons for the !gun command during freeze per…
Browse files Browse the repository at this point in the history
…iod.
  • Loading branch information
B3none committed Jan 11, 2024
1 parent 2b0e721 commit cd01e14
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions RetakesAllocator/Helpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
2 changes: 1 addition & 1 deletion RetakesAllocator/RetakesAllocator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit cd01e14

Please sign in to comment.