diff --git a/src/Events.cs b/src/Events.cs index 813e948..a243a6f 100644 --- a/src/Events.cs +++ b/src/Events.cs @@ -11,8 +11,8 @@ private HookResult OnRoundStart(EventRoundStart @event, GameEventInfo info) _roundStart = Server.CurrentTime; _bombPlanted = false; - var gameRules = Utilities.FindAllEntitiesByDesignerName("cs_gamerules").First().GameRules!; - _warmup = gameRules.WarmupPeriod; + _gameRules ??= Utilities.FindAllEntitiesByDesignerName("cs_gamerules").First().GameRules!; + _warmup = _gameRules?.WarmupPeriod; foreach (var zone in _zones) { diff --git a/src/Globals.cs b/src/Globals.cs index fbc59cb..1b8f4a2 100644 --- a/src/Globals.cs +++ b/src/Globals.cs @@ -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(); @@ -20,4 +20,5 @@ public partial class AntiRush private bool _bombPlanted; private bool _warmup; private float[] _countdown = []; + private CCSGameRules? _gameRules; } \ No newline at end of file