diff --git a/RetakesPlugin/Modules/Helpers.cs b/RetakesPlugin/Modules/Helpers.cs index 12afb26..fa0e6ff 100644 --- a/RetakesPlugin/Modules/Helpers.cs +++ b/RetakesPlugin/Modules/Helpers.cs @@ -29,7 +29,7 @@ public static bool IsValidPlayer(CCSPlayerController? player) return player != null && player.IsValid; } - public static bool DoesPlayerHavePawn(CCSPlayerController? player, bool shouldBeAlive = true) + public static bool DoesPlayerHaveAlivePawn(CCSPlayerController? player, bool shouldBeAlive = true) { if (!IsValidPlayer(player)) { diff --git a/RetakesPlugin/Modules/Managers/SpawnManager.cs b/RetakesPlugin/Modules/Managers/SpawnManager.cs index 1b7d7c9..fa3f9ff 100644 --- a/RetakesPlugin/Modules/Managers/SpawnManager.cs +++ b/RetakesPlugin/Modules/Managers/SpawnManager.cs @@ -19,8 +19,8 @@ public SpawnManager(MapConfig mapConfig) public void CalculateMapSpawns() { - _spawns.Clear(); - + _spawns.Clear(); + _spawns.Add(Bombsite.A, new Dictionary>() { { CsTeam.Terrorist, new List()}, @@ -43,8 +43,8 @@ public List GetSpawns(Bombsite bombsite, CsTeam? team = null) if (_spawns[bombsite][CsTeam.Terrorist].Count == 0 && _spawns[bombsite][CsTeam.CounterTerrorist].Count == 0) { return new List(); - } - + } + if (team == null) { return _spawns[bombsite].SelectMany(entry => entry.Value).ToList(); @@ -89,7 +89,7 @@ public List GetSpawns(Bombsite bombsite, CsTeam? team = null) foreach (var player in Helpers.Shuffle(players)) { - if (!Helpers.DoesPlayerHavePawn(player)) + if (!Helpers.DoesPlayerHaveAlivePawn(player)) { continue; } diff --git a/RetakesPlugin/RetakesPlugin.cs b/RetakesPlugin/RetakesPlugin.cs index cc6abd3..e6708d5 100644 --- a/RetakesPlugin/RetakesPlugin.cs +++ b/RetakesPlugin/RetakesPlugin.cs @@ -17,10 +17,10 @@ namespace RetakesPlugin; -[MinimumApiVersion(201)] +[MinimumApiVersion(220)] public class RetakesPlugin : BasePlugin { - private const string Version = "2.0.3"; + private const string Version = "2.0.4"; #region Plugin info public override string ModuleName => "Retakes Plugin"; @@ -150,9 +150,9 @@ public void OnCommandAddSpawn(CCSPlayerController? player, CommandInfo commandIn return; } - if (!Helpers.DoesPlayerHavePawn(player)) + if (!Helpers.DoesPlayerHaveAlivePawn(player)) { - commandInfo.ReplyToCommand($"{MessagePrefix}You must be a player."); + commandInfo.ReplyToCommand($"{MessagePrefix}You must have an alive player pawn."); return; } @@ -247,7 +247,7 @@ public void OnCommandRemoveSpawn(CCSPlayerController? player, CommandInfo comman return; } - if (!Helpers.DoesPlayerHavePawn(player)) + if (!Helpers.DoesPlayerHaveAlivePawn(player)) { return; } @@ -334,7 +334,7 @@ public void OnCommandNearestSpawn(CCSPlayerController? player, CommandInfo comma return; } - if (!Helpers.DoesPlayerHavePawn(player)) + if (!Helpers.DoesPlayerHaveAlivePawn(player)) { return; } diff --git a/RetakesPlugin/RetakesPlugin.csproj b/RetakesPlugin/RetakesPlugin.csproj index a94c866..1b85262 100644 --- a/RetakesPlugin/RetakesPlugin.csproj +++ b/RetakesPlugin/RetakesPlugin.csproj @@ -6,7 +6,7 @@ - +