From 8242e509af8022c3aa0d21dd4c0f2a5248f5036f Mon Sep 17 00:00:00 2001 From: NotZer0Two Date: Mon, 12 Aug 2024 20:32:33 +0200 Subject: [PATCH 1/2] Fix --- .../Patches/Fixes/NWFixDetonationTimer.cs | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 EXILED/Exiled.Events/Patches/Fixes/NWFixDetonationTimer.cs diff --git a/EXILED/Exiled.Events/Patches/Fixes/NWFixDetonationTimer.cs b/EXILED/Exiled.Events/Patches/Fixes/NWFixDetonationTimer.cs new file mode 100644 index 000000000..702994975 --- /dev/null +++ b/EXILED/Exiled.Events/Patches/Fixes/NWFixDetonationTimer.cs @@ -0,0 +1,31 @@ +// ----------------------------------------------------------------------- +// +// Copyright (c) Exiled Team. All rights reserved. +// Licensed under the CC BY-SA 3.0 license. +// +// ----------------------------------------------------------------------- + +namespace Exiled.Events.Patches.Fixes +{ + using System; + using System.Linq; + + using GameCore; + using HarmonyLib; + + /// + /// Fixes the issue where the game was not selecting the scenario with the nearest value. + /// + [HarmonyPatch(typeof(AlphaWarheadController), nameof(AlphaWarheadController.Start))] + internal class NWFixDetonationTimer + { + private static void Postfix() + { + AlphaWarheadSyncInfo networkInfo = default; + networkInfo.ScenarioId = Array.IndexOf(AlphaWarheadController.Singleton._startScenarios, AlphaWarheadController.Singleton._startScenarios.OrderBy(d => Math.Abs(d.TimeToDetonate - ConfigFile.ServerConfig.GetInt("warhead_tminus_start_duration", 90))).First()); + + AlphaWarheadController.Singleton.NetworkInfo = networkInfo; + return; + } + } +} From f2c3f1e125804a5b1b38c97dc60c7bc52ca0c747 Mon Sep 17 00:00:00 2001 From: NotZer0Two Date: Mon, 12 Aug 2024 20:48:33 +0200 Subject: [PATCH 2/2] Added the Bug report --- EXILED/Exiled.Events/Patches/Fixes/NWFixDetonationTimer.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/EXILED/Exiled.Events/Patches/Fixes/NWFixDetonationTimer.cs b/EXILED/Exiled.Events/Patches/Fixes/NWFixDetonationTimer.cs index 702994975..fec4aa869 100644 --- a/EXILED/Exiled.Events/Patches/Fixes/NWFixDetonationTimer.cs +++ b/EXILED/Exiled.Events/Patches/Fixes/NWFixDetonationTimer.cs @@ -15,6 +15,7 @@ namespace Exiled.Events.Patches.Fixes /// /// Fixes the issue where the game was not selecting the scenario with the nearest value. + /// Bug Report /// [HarmonyPatch(typeof(AlphaWarheadController), nameof(AlphaWarheadController.Start))] internal class NWFixDetonationTimer