Weapon/radio slowdown

This commit is contained in:
EntenKoeniq
2021-07-14 08:09:26 +02:00
parent fbacb8dc0a
commit 4b1fddd64a
2 changed files with 16 additions and 7 deletions

View File

@ -161,6 +161,7 @@ namespace CoopClient
KeyDown += OnKeyDown;
Util.NativeMemory();
Util.DisableSlowMo();
}
private int LastDataSend;

View File

@ -73,12 +73,6 @@ namespace CoopClient
return new IntPtr((long)GetEntityAddressFunc(handle));
}
public static unsafe void WriteFloat(IntPtr address, float value)
{
var data = (float*)address.ToPointer();
*data = value;
}
public static unsafe void CustomSteeringAngle(int Handle, float value)
{
var address = GetEntityAddress(Handle);
@ -87,7 +81,21 @@ namespace CoopClient
return;
}
WriteFloat(address + SteeringAngleOffset, value);
*(float*)(address + SteeringAngleOffset).ToPointer() = value;
}
public static unsafe void DisableSlowMo()
{
var address = FindPattern("\x32\xc0\xf3\x0f\x11\x09", "xxxxxx"); // Weapon / Radio slowdown
if (address == null)
{
return;
}
for (int i = 0; i < 6; i++)
{
*(byte*)((IntPtr)address + i).ToPointer() = 0x90;
}
}
#endregion