diff --git a/Features/NominationCommand.cs b/Features/NominationCommand.cs index 275d873..b5f58f1 100644 --- a/Features/NominationCommand.cs +++ b/Features/NominationCommand.cs @@ -80,21 +80,23 @@ public void CommandHandler(CCSPlayerController? player, string map) return; } - if (!_config.EnabledInWarmup && _gamerules.WarmupRunning) + if (_gamerules.WarmupRunning) { - player.PrintToChat(_localizer.LocalizeWithPrefix("general.validation.warmup")); - return; + if (!_config.EnabledInWarmup) + { + player.PrintToChat(_localizer.LocalizeWithPrefix("general.validation.warmup")); + return; + } } - - if (ServerManager.ValidPlayerCount() < _config!.MinPlayers) + else if (_config.MinRounds > 0 && _config.MinRounds > _gamerules.TotalRoundsPlayed) { - player.PrintToChat(_localizer.LocalizeWithPrefix("general.validation.minimum-players", _config!.MinPlayers)); + player!.PrintToChat(_localizer.LocalizeWithPrefix("general.validation.minimum-rounds", _config.MinRounds)); return; } - if (_config.MinRounds > 0 && _config.MinRounds > _gamerules.TotalRoundsPlayed) + if (ServerManager.ValidPlayerCount() < _config!.MinPlayers) { - player!.PrintToChat(_localizer.LocalizeWithPrefix("general.validation.minimum-rounds", _config.MinRounds)); + player.PrintToChat(_localizer.LocalizeWithPrefix("general.validation.minimum-players", _config!.MinPlayers)); return; } diff --git a/Features/RockTheVoteCommand.cs b/Features/RockTheVoteCommand.cs index 54121ba..b1abe3e 100644 --- a/Features/RockTheVoteCommand.cs +++ b/Features/RockTheVoteCommand.cs @@ -57,21 +57,23 @@ public void CommandHandler(CCSPlayerController? player) return; } - if (!_config.EnabledInWarmup && _gameRules.WarmupRunning) + if (_gameRules.WarmupRunning) { - player.PrintToChat(_localizer.LocalizeWithPrefix("general.validation.warmup")); - return; + if (!_config.EnabledInWarmup) + { + player.PrintToChat(_localizer.LocalizeWithPrefix("general.validation.warmup")); + return; + } } - - if (ServerManager.ValidPlayerCount() < _config!.MinPlayers) + else if (_config.MinRounds > 0 && _config.MinRounds > _gameRules.TotalRoundsPlayed) { - player.PrintToChat(_localizer.LocalizeWithPrefix("general.validation.minimum-players", _config!.MinPlayers)); + player!.PrintToChat(_localizer.LocalizeWithPrefix("general.validation.minimum-rounds", _config.MinRounds)); return; } - if (_config.MinRounds > 0 && _config.MinRounds > _gameRules.TotalRoundsPlayed) + if (ServerManager.ValidPlayerCount() < _config!.MinPlayers) { - player!.PrintToChat(_localizer.LocalizeWithPrefix("general.validation.minimum-rounds", _config.MinRounds)); + player.PrintToChat(_localizer.LocalizeWithPrefix("general.validation.minimum-players", _config!.MinPlayers)); return; } diff --git a/Features/TimeLeftCommand.cs b/Features/TimeLeftCommand.cs index 1f71b3b..7b8feb7 100644 --- a/Features/TimeLeftCommand.cs +++ b/Features/TimeLeftCommand.cs @@ -41,7 +41,7 @@ public void CommandHandler(CCSPlayerController? player) if (_gameRules.WarmupRunning) { - if(player is not null) + if (player is not null) player.PrintToChat(_localizer.LocalizeWithPrefix("general.validation.warmup")); else Server.PrintToConsole(_localizer.LocalizeWithPrefix("general.validation.warmup")); diff --git a/Features/VotemapCommand.cs b/Features/VotemapCommand.cs index 3db2352..ba79d86 100644 --- a/Features/VotemapCommand.cs +++ b/Features/VotemapCommand.cs @@ -81,21 +81,23 @@ public void CommandHandler(CCSPlayerController? player, string map) return; } - if (!_config.EnabledInWarmup && _gamerules.WarmupRunning) + if (_gamerules.WarmupRunning) { - player.PrintToChat(_localizer.LocalizeWithPrefix("general.validation.warmup")); - return; + if (!_config.EnabledInWarmup) + { + player.PrintToChat(_localizer.LocalizeWithPrefix("general.validation.warmup")); + return; + } } - - if (ServerManager.ValidPlayerCount() < _config!.MinPlayers) + else if (_config.MinRounds > 0 && _config.MinRounds > _gamerules.TotalRoundsPlayed) { - player.PrintToChat(_localizer.LocalizeWithPrefix("general.validation.minimum-players", _config!.MinPlayers)); + player!.PrintToChat(_localizer.LocalizeWithPrefix("general.validation.minimum-rounds", _config.MinRounds)); return; } - if (_config.MinRounds > 0 && _config.MinRounds > _gamerules.TotalRoundsPlayed) + if (ServerManager.ValidPlayerCount() < _config!.MinPlayers) { - player!.PrintToChat(_localizer.LocalizeWithPrefix("general.validation.minimum-rounds", _config.MinRounds)); + player.PrintToChat(_localizer.LocalizeWithPrefix("general.validation.minimum-players", _config!.MinPlayers)); return; } diff --git a/Plugin.cs b/Plugin.cs index 4a09bee..861f357 100644 --- a/Plugin.cs +++ b/Plugin.cs @@ -21,7 +21,7 @@ public void ConfigureServices(IServiceCollection serviceCollection) public partial class Plugin : BasePlugin, IPluginConfig { public override string ModuleName => "RockTheVote"; - public override string ModuleVersion => "1.7.6"; + public override string ModuleVersion => "1.7.7"; public override string ModuleAuthor => "abnerfs"; public override string ModuleDescription => "General purpose map voting plugin"; @@ -67,7 +67,7 @@ public override void Load(bool hotReload) public HookResult OnChat(EventPlayerChat @event, GameEventInfo info) { var player = Utilities.GetPlayerFromUserid(@event.Userid); - if(player is not null) + if (player is not null) { var text = @event.Text.Trim().ToLower(); if (text == "rtv")