From b381539f4274e48d9477c1fdb5317698dca31e25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=8B=E6=B0=B4?= <1123993881@qq.com> Date: Fri, 31 Mar 2023 21:23:44 +0800 Subject: [PATCH] fix: input will be disable when in pvp zone. --- RotationSolver/Updaters/InputUpdater.cs | 4 ++-- RotationSolver/Updaters/SocialUpdater.cs | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/RotationSolver/Updaters/InputUpdater.cs b/RotationSolver/Updaters/InputUpdater.cs index 3947cfb41..e23550dca 100644 --- a/RotationSolver/Updaters/InputUpdater.cs +++ b/RotationSolver/Updaters/InputUpdater.cs @@ -92,7 +92,7 @@ private static void KeyDown(KeyRecord key) return; } - if (!Service.Config.UseKeyboardCommand) return; + if (!Service.Config.UseKeyboardCommand || SocialUpdater.InPvp) return; if (Service.Config.KeyState.ContainsValue(key)) { @@ -130,7 +130,7 @@ private static void ButtonDown(ButtonRecord button) return; } - if (!Service.Config.UseGamepadCommand) return; + if (!Service.Config.UseGamepadCommand || SocialUpdater.InPvp) return; if (Service.Config.ButtonState.ContainsValue(button)) { diff --git a/RotationSolver/Updaters/SocialUpdater.cs b/RotationSolver/Updaters/SocialUpdater.cs index 9419e5d34..cfc1c4932 100644 --- a/RotationSolver/Updaters/SocialUpdater.cs +++ b/RotationSolver/Updaters/SocialUpdater.cs @@ -13,6 +13,7 @@ namespace RotationSolver.Updaters; internal class SocialUpdater { + public static bool InPvp { get; private set; } static List _macroToAuthor = new List() { "blush", @@ -73,6 +74,7 @@ static void ClientState_TerritoryChanged(object sender, ushort e) { _canSaying = true; } + InPvp = territory.IsPvpZone; DataCenter.InHighEndDuty = HighEndDuties.Any(t => t.RowId == territory.RowId); }