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,24 @@
using System.Reflection;
using NitroxModel.Helper;
using UnityEngine;
namespace NitroxPatcher.Patches.Dynamic;
public sealed partial class GotoConsoleCommand_GotoPosition_Patch : NitroxPatch, IDynamicPatch
{
private static readonly MethodInfo TARGET_METHOD = Reflect.Method((GotoConsoleCommand t) => t.GotoPosition(default, default));
public static bool Prefix(Vector3 position)
{
Vehicle currentMountedVehicle = Player.main.currentMountedVehicle;
if (currentMountedVehicle)
{
// Handle GoTo with a vehicle teleport, which takes player too
currentMountedVehicle.TeleportVehicle(position, currentMountedVehicle.transform.rotation);
return false;
}
// Normal GoTo behaviour if not in vehicle
return true;
}
}