mirror of
https://github.com/sp-tarkov/modules.git
synced 2025-02-13 06:10:45 -05:00
Clamp the Y velocity so bots dont go flying into the air.
This commit is contained in:
parent
9c89c31c68
commit
2fbaef5eff
@ -75,6 +75,7 @@ namespace Aki.Custom
|
||||
new ResetTraderServicesPatch().Enable();
|
||||
new CultistAmuletRemovalPatch().Enable();
|
||||
new HalloweenExtractPatch().Enable();
|
||||
new ClampRagdollPatch().Enable();
|
||||
|
||||
HookObject.AddOrGetComponent<MenuNotificationManager>();
|
||||
}
|
||||
|
22
project/Aki.Custom/Patches/ClampRagdollPatch.cs
Normal file
22
project/Aki.Custom/Patches/ClampRagdollPatch.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user