first commit

This commit is contained in:
2025-07-06 00:23:46 +02:00
commit 38f50c8819
1788 changed files with 112878 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
using System.Reflection;
using NitroxModel.Helper;
using UnityEngine;
namespace NitroxPatcher.Patches.Dynamic;
public sealed partial class Player_WarpForward_Patch : NitroxPatch, IDynamicPatch
{
private static readonly MethodInfo TARGET_METHOD = Reflect.Method((Player t) => t.OnConsoleCommand_warpforward(default));
public static bool Prefix(Player __instance, NotificationCenter.Notification n)
{
Vehicle currentMountedVehicle = __instance.currentMountedVehicle;
if (!currentMountedVehicle)
{
return true;
}
// Code from the original method
DevConsole.ParseFloat(n, 0, out var value, 3f);
Transform aimingTransform = __instance.camRoot.GetAimingTransform();
Vector3 targetPosition = __instance.transform.position + aimingTransform.forward * value;
currentMountedVehicle.TeleportVehicle(targetPosition, currentMountedVehicle.transform.rotation);
__instance.WaitForTeleportation();
return false;
}
}