Skip to content

Commit 5254126

Browse files
authored
Merge pull request #18 from oscar-wos/spawn-zone-fix
2.0.2
2 parents fcd721c + 973af32 commit 5254126

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/Globals.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace AntiRush;
88
public partial class AntiRush
99
{
1010
public override string ModuleName => "AntiRush";
11-
public override string ModuleVersion => "2.0.1";
11+
public override string ModuleVersion => "2.0.2";
1212
public override string ModuleAuthor => "https://github.com/oscar-wos/AntiRush";
1313
public AntiRushConfig Config { get; set; } = new();
1414
public Menu.Menu Menu { get; } = new();

src/Listeners.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using AntiRush.Classes;
22
using AntiRush.Extensions;
33
using CounterStrikeSharp.API;
4+
using CounterStrikeSharp.API.Core;
45
using FixVectorLeak.Extensions;
56
using FixVectorLeak.Structs;
67

@@ -16,7 +17,7 @@ private void OnTick()
1617
if (!_minPlayers || !_maxPlayers)
1718
return;
1819

19-
foreach (var player in Utilities.GetPlayers().Where(p => p.IsValid() && p.PawnIsAlive))
20+
foreach (var player in Utilities.GetPlayers().Where(p => p.IsValid() && (LifeState_t)p.PlayerPawn.Value!.LifeState == LifeState_t.LIFE_ALIVE))
2021
{
2122
if (player.PlayerPawn.Value?.AbsOrigin == null)
2223
continue;
@@ -44,6 +45,9 @@ private void OnTick()
4445
if (!zone.Teams.Contains(player.Team))
4546
continue;
4647

48+
if (!zone.Entry.ContainsKey(player))
49+
zone.Entry[player] = 0;
50+
4751
if (!isInZone)
4852
{
4953
zone.Entry[player] = 0;

0 commit comments

Comments
 (0)