mirror of
https://github.com/soarqin/DSP_Mods_TO.git
synced 2025-12-14 18:43:29 +08:00
Added CruiseAssist and AutoPilot
This commit is contained in:
31
CruiseAssist/Patches/Patch_PlayerMoveDrift.cs
Normal file
31
CruiseAssist/Patches/Patch_PlayerMoveDrift.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using HarmonyLib;
|
||||
|
||||
namespace CruiseAssist.Patches;
|
||||
|
||||
[HarmonyPatch(typeof(PlayerMove_Drift))]
|
||||
internal class Patch_PlayerMoveDrift
|
||||
{
|
||||
[HarmonyPatch("GameTick")]
|
||||
[HarmonyPrefix]
|
||||
public static void GameTick_Prefix(PlayerMove_Drift __instance)
|
||||
{
|
||||
if (!CruiseAssistPlugin.Enable) return;
|
||||
if (!CruiseAssistPlugin.TargetSelected) return;
|
||||
if (__instance.controller.movementStateInFrame != EMovementState.Drift) 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.OperateDrift(__instance);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user