From 39385acc13da82b0d1cc970ac2723f8ce1d7686b Mon Sep 17 00:00:00 2001 From: oscar-wos <29248751+oscar-wos@users.noreply.github.com> Date: Mon, 12 Aug 2024 10:49:43 +0100 Subject: [PATCH 1/2] revert: https://github.com/oscar-wos/AntiRush/commit/968f8064e2d38d6d41c37586c2c627fc5d7ea5b9 --- src/AntiRush.cs | 2 -- src/Events.cs | 4 ++-- src/Globals.cs | 3 +-- src/Zone.cs | 2 +- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/AntiRush.cs b/src/AntiRush.cs index b025afd..ebf7bd5 100644 --- a/src/AntiRush.cs +++ b/src/AntiRush.cs @@ -31,8 +31,6 @@ public override void Load(bool isReload) Server.NextFrame(() => { - _gameRules = Utilities.FindAllEntitiesByDesignerName("cs_gamerules").First().GameRules!; - foreach (var controller in Utilities.GetPlayers()) _playerData[controller] = new PlayerData(); diff --git a/src/Events.cs b/src/Events.cs index 729e485..813e948 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; - _gameRules ??= Utilities.FindAllEntitiesByDesignerName("cs_gamerules").First().GameRules!; - _warmup = _gameRules.WarmupPeriod; + var 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 20e92ec..1af3e14 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.5"; public override string ModuleAuthor => "https://github.com/oscar-wos/AntiRush"; public AntiRushConfig Config { get; set; } = new(); public Menu.Menu Menu { get; } = new(); @@ -20,5 +20,4 @@ public partial class AntiRush private bool _bombPlanted; private bool _warmup; private float[] _countdown = []; - private CCSGameRules? _gameRules; } \ No newline at end of file diff --git a/src/Zone.cs b/src/Zone.cs index d7a3e11..64f8fbd 100644 --- a/src/Zone.cs +++ b/src/Zone.cs @@ -16,7 +16,7 @@ public class Zone(string name, ZoneType type, float delay, int damage, CsTeam[] public CsTeam[] Teams { get; init; } = teams; public Vector MinPoint { get; init; } = minPoint; public Vector MaxPoint { get; init; } = maxPoint; - public Dictionary Data { get; set; } = []; + public Dictionary Data { get; } = []; public CBeam[] Beams { get; } = []; public bool IsInZone(Vector point) From a9d6f5ab655b6626781b13894eedcd6cfe1b9f53 Mon Sep 17 00:00:00 2001 From: oscar-wos <29248751+oscar-wos@users.noreply.github.com> Date: Mon, 12 Aug 2024 10:50:19 +0100 Subject: [PATCH 2/2] fix: revert --- src/Globals.cs | 2 +- src/Zone.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Globals.cs b/src/Globals.cs index 1af3e14..fbc59cb 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.5"; + public override string ModuleVersion => "1.0.6"; public override string ModuleAuthor => "https://github.com/oscar-wos/AntiRush"; public AntiRushConfig Config { get; set; } = new(); public Menu.Menu Menu { get; } = new(); diff --git a/src/Zone.cs b/src/Zone.cs index 64f8fbd..d7a3e11 100644 --- a/src/Zone.cs +++ b/src/Zone.cs @@ -16,7 +16,7 @@ public class Zone(string name, ZoneType type, float delay, int damage, CsTeam[] public CsTeam[] Teams { get; init; } = teams; public Vector MinPoint { get; init; } = minPoint; public Vector MaxPoint { get; init; } = maxPoint; - public Dictionary Data { get; } = []; + public Dictionary Data { get; set; } = []; public CBeam[] Beams { get; } = []; public bool IsInZone(Vector point)