mirror of
https://github.com/soarqin/DSP_Mods_TO.git
synced 2025-12-12 01:23:31 +08:00
31 lines
969 B
C#
31 lines
969 B
C#
using HarmonyLib;
|
|
|
|
namespace CruiseAssist.Patches;
|
|
|
|
[HarmonyPatch(typeof(PlayerMove_Fly))]
|
|
internal class Patch_PlayerMoveFly
|
|
{
|
|
[HarmonyPatch("GameTick")]
|
|
[HarmonyPrefix]
|
|
public static void GameTick_Prefix(PlayerMove_Fly __instance)
|
|
{
|
|
if (!CruiseAssistPlugin.Enable) return;
|
|
if (!CruiseAssistPlugin.TargetSelected) return;
|
|
if (__instance.controller.movementStateInFrame != EMovementState.Fly) return;
|
|
if (VFInput._moveForward.pressing || VFInput._pullUp.pressing)
|
|
{
|
|
CruiseAssistPlugin.Interrupt = true;
|
|
CruiseAssistPlugin.Extensions.ForEach(delegate(ICruiseAssistExtensionAPI extension)
|
|
{
|
|
extension.CancelOperate();
|
|
});
|
|
}
|
|
else
|
|
{
|
|
CruiseAssistPlugin.Extensions.ForEach(delegate(ICruiseAssistExtensionAPI extension)
|
|
{
|
|
extension.OperateFly(__instance);
|
|
});
|
|
}
|
|
}
|
|
} |