Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
fix: chagned the move.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Feb 23, 2023
1 parent 3870dff commit 0d85749
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 16 deletions.
1 change: 1 addition & 0 deletions RotationSolver/Localization/Localization.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
"Configwindow_Param_ShowInfoOnToast": "Display plugin state on toast",
"Configwindow_Param_NamePlateIconId": "Player's name plate icon id when state is on. Recommand 61435, 61437",
"Configwindow_Param_Action": "Action",
"Configwindow_Param_UseAOEAction": "Use AOE actions",
"Configwindow_Param_UseAOEWhenManual": "Use AOE actions in manual mode",
"Configwindow_Param_AutoBurst": "Automatic burst",
"Configwindow_Param_UseAbility": "Auto-use abilities",
Expand Down
2 changes: 0 additions & 2 deletions RotationSolver/Updaters/MajorUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ private static void FrameworkUpdate(Framework framework)
PreviewUpdater.UpdatePreview();
ActionUpdater.DoAction();
MacroUpdater.UpdateMacro();

MovingUpdater.UpdateLocation();
}

static bool _work = true;
Expand Down
17 changes: 3 additions & 14 deletions RotationSolver/Updaters/MovingUpdater.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Dalamud.Game.ClientState.Conditions;
using Dalamud.Hooking;
using FFXIVClientStructs.FFXIV.Client.UI.Agent;
using RotationSolver.Data;
using RotationSolver.Helpers;
using System;
Expand All @@ -22,15 +23,6 @@ internal static void Dispose()
movingHook.Disable();
}

internal static void UpdateLocation()
{
if (Service.ClientState.LocalPlayer == null) return;
var p = Service.ClientState.LocalPlayer.Position;

_moving = _lastPosition != p;
_lastPosition = p;
}

private static bool MovingDetour(IntPtr ptr)
{
if (Service.Conditions[ConditionFlag.OccupiedInEvent])
Expand All @@ -45,12 +37,9 @@ private static bool MovingDetour(IntPtr ptr)
}
return movingHook.Original(ptr);
}

static Vector3 _lastPosition = Vector3.Zero;
static bool _moving = false;
internal static bool IsMoving
internal static unsafe bool IsMoving
{
get => _moving;
get => AgentMap.Instance()->IsPlayerMoving > 0;
set => _posLocker = !value;
}
}

0 comments on commit 0d85749

Please sign in to comment.