0
0
mirror of https://github.com/sp-tarkov/modules.git synced 2025-02-13 02:10:45 -05:00

Clamp the Y velocity so bots dont go flying into the air.

This commit is contained in:
Kaeno 2024-04-01 14:03:10 +01:00
parent 9c89c31c68
commit 2fbaef5eff
2 changed files with 23 additions and 0 deletions

View File

@ -75,6 +75,7 @@ namespace Aki.Custom
new ResetTraderServicesPatch().Enable();
new CultistAmuletRemovalPatch().Enable();
new HalloweenExtractPatch().Enable();
new ClampRagdollPatch().Enable();
HookObject.AddOrGetComponent<MenuNotificationManager>();
}

View File

@ -0,0 +1,22 @@
using Aki.Reflection.Patching;
using EFT.Interactive;
using HarmonyLib;
using System.Reflection;
using UnityEngine;
namespace Aki.Custom.Patches
{
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)
{
velocity.y = Mathf.Clamp(velocity.y, -1f, 1f);
}
}
}