Skip to content

Commit

Permalink
Helper function rename, and bumped cssharp version
Browse files Browse the repository at this point in the history
  • Loading branch information
B3none committed Apr 29, 2024
1 parent e69899f commit 2cb9791
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion RetakesPlugin/Modules/Helpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
{
Expand Down
10 changes: 5 additions & 5 deletions RetakesPlugin/Modules/Managers/SpawnManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ public SpawnManager(MapConfig mapConfig)

public void CalculateMapSpawns()
{
_spawns.Clear();

_spawns.Clear();

_spawns.Add(Bombsite.A, new Dictionary<CsTeam, List<Spawn>>()
{
{ CsTeam.Terrorist, new List<Spawn>()},
Expand All @@ -43,8 +43,8 @@ public List<Spawn> GetSpawns(Bombsite bombsite, CsTeam? team = null)
if (_spawns[bombsite][CsTeam.Terrorist].Count == 0 && _spawns[bombsite][CsTeam.CounterTerrorist].Count == 0)
{
return new List<Spawn>();
}

}

if (team == null)
{
return _spawns[bombsite].SelectMany(entry => entry.Value).ToList();
Expand Down Expand Up @@ -89,7 +89,7 @@ public List<Spawn> GetSpawns(Bombsite bombsite, CsTeam? team = null)

foreach (var player in Helpers.Shuffle(players))
{
if (!Helpers.DoesPlayerHavePawn(player))
if (!Helpers.DoesPlayerHaveAlivePawn(player))
{
continue;
}
Expand Down
12 changes: 6 additions & 6 deletions RetakesPlugin/RetakesPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -247,7 +247,7 @@ public void OnCommandRemoveSpawn(CCSPlayerController? player, CommandInfo comman
return;
}

if (!Helpers.DoesPlayerHavePawn(player))
if (!Helpers.DoesPlayerHaveAlivePawn(player))
{
return;
}
Expand Down Expand Up @@ -334,7 +334,7 @@ public void OnCommandNearestSpawn(CCSPlayerController? player, CommandInfo comma
return;
}

if (!Helpers.DoesPlayerHavePawn(player))
if (!Helpers.DoesPlayerHaveAlivePawn(player))
{
return;
}
Expand Down
2 changes: 1 addition & 1 deletion RetakesPlugin/RetakesPlugin.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CounterStrikeSharp.API" Version="1.0.201" />
<PackageReference Include="CounterStrikeSharp.API" Version="1.0.220" />
<PackageReference Include="Microsoft.Extensions.Localization.Abstractions" Version="8.0.3" />
<ProjectReference Include="..\RetakesPluginShared\RetakesPluginShared.csproj" />
</ItemGroup>
Expand Down

0 comments on commit 2cb9791

Please sign in to comment.