Skip to content

Commit

Permalink
fix: cs_gamerules
Browse files Browse the repository at this point in the history
  • Loading branch information
oscar-wos committed Oct 12, 2024
1 parent 92229cf commit 7280c66
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Events.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ private HookResult OnRoundStart(EventRoundStart @event, GameEventInfo info)
_roundStart = Server.CurrentTime;
_bombPlanted = false;

var gameRules = Utilities.FindAllEntitiesByDesignerName<CCSGameRulesProxy>("cs_gamerules").First().GameRules!;
_warmup = gameRules.WarmupPeriod;
_gameRules ??= Utilities.FindAllEntitiesByDesignerName<CCSGameRulesProxy>("cs_gamerules").First().GameRules!;
_warmup = _gameRules?.WarmupPeriod;

Check failure on line 15 in src/Events.cs

View workflow job for this annotation

GitHub Actions / build

Cannot implicitly convert type 'bool?' to 'bool'. An explicit conversion exists (are you missing a cast?)

Check warning on line 15 in src/Events.cs

View workflow job for this annotation

GitHub Actions / build

Nullable value type may be null.

Check warning on line 15 in src/Events.cs

View workflow job for this annotation

GitHub Actions / build

Nullable value type may be null.

Check failure on line 15 in src/Events.cs

View workflow job for this annotation

GitHub Actions / build

Cannot implicitly convert type 'bool?' to 'bool'. An explicit conversion exists (are you missing a cast?)

foreach (var zone in _zones)
{
Expand Down
3 changes: 2 additions & 1 deletion src/Globals.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace AntiRush;
public partial class AntiRush
{
public override string ModuleName => "AntiRush";
public override string ModuleVersion => "1.0.6";
public override string ModuleVersion => "1.0.7";
public override string ModuleAuthor => "https://github.com/oscar-wos/AntiRush";
public AntiRushConfig Config { get; set; } = new();
public Menu.Menu Menu { get; } = new();
Expand All @@ -20,4 +20,5 @@ public partial class AntiRush
private bool _bombPlanted;
private bool _warmup;
private float[] _countdown = [];
private CCSGameRules? _gameRules;
}

0 comments on commit 7280c66

Please sign in to comment.