2024-05-21 19:10:17 +01:00
|
|
|
|
using SPT.Reflection.Patching;
|
2024-04-01 14:03:10 +01:00
|
|
|
|
using EFT.Interactive;
|
|
|
|
|
using HarmonyLib;
|
|
|
|
|
using System.Reflection;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
2024-05-21 19:10:17 +01:00
|
|
|
|
namespace SPT.Custom.Patches
|
2024-04-01 14:03:10 +01:00
|
|
|
|
{
|
|
|
|
|
public class ClampRagdollPatch : ModulePatch
|
|
|
|
|
{
|
|
|
|
|
protected override MethodBase GetTargetMethod()
|
|
|
|
|
{
|
|
|
|
|
return AccessTools.Method(typeof(Corpse), nameof(Corpse.method_16));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[PatchPrefix]
|
|
|
|
|
private static void PatchPreFix(ref Vector3 velocity)
|
|
|
|
|
{
|
2024-04-05 00:43:38 +01:00
|
|
|
|
velocity.y = Mathf.Clamp(velocity.y, -2f, 2f);
|
2024-04-01 14:03:10 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|