using System.Reflection; using NitroxClient.MonoBehaviours.Vehicles; using NitroxModel.Helper; using UnityEngine; namespace NitroxPatcher.Patches.Dynamic; /// /// Gives the real velocity data for to play the right step sounds. /// public sealed partial class Exosuit_GetVelocity_Patch : NitroxPatch, IDynamicPatch { private static readonly MethodInfo targetMethod = Reflect.Method((Exosuit t) => ((IGroundMoveable)t).GetVelocity()); public static bool Prefix(Exosuit __instance, ref Vector3 __result) { if (__instance.TryGetComponent(out ExosuitMovementReplicator exosuitMovementReplicator)) { __result = exosuitMovementReplicator.velocity; return false; } return true; } }