Skip to content

Commit

Permalink
Check timelimit regardless of gamemode
Browse files Browse the repository at this point in the history
  • Loading branch information
MSWS authored Mar 30, 2024
1 parent 4d4a080 commit ccc872c
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions Features/EndOfMapVote.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ public class EndOfMapVote : IPluginDependency<Plugin, Config>
private EndMapVoteManager _voteManager;
private EndOfMapConfig _config = new();
private Timer? _timer;
private bool deathMatch => _gameMode?.GetPrimitiveValue<int>() == 2 && _gameType?.GetPrimitiveValue<int>() == 1;
private ConVar? _gameType;
private ConVar? _gameMode;

Expand Down Expand Up @@ -69,9 +68,6 @@ void KillTimer()

public void OnLoad(Plugin plugin)
{
_gameMode = ConVar.Find("game_mode");
_gameType = ConVar.Find("game_type");

void MaybeStartTimer()
{
KillTimer();
Expand All @@ -93,7 +89,7 @@ void MaybeStartTimer()

if (!_pluginState.DisableCommands && !_gameRules.WarmupRunning && CheckMaxRounds() && _config.Enabled)
StartVote();
else if (deathMatch)
else
{
MaybeStartTimer();
}
Expand Down

0 comments on commit ccc872c

Please sign in to comment.