-
Автор темы
- #1
This is a resolver which i was getting lots of things together and it may be useful, please tell me if its useful or not since I don't have time to try it.
Very unproper code :) I had 3 min to make this and just got some things together :)
Код:
float get_max_desync_delta_aimware ()
{
auto thisptr = entity-> GetPlayerAnimState ();
auto v1 = ((float) thisptr) [62];
auto v2 = 1.0f;
auto v3 = 0.0f;
auto v4 = 0.f;
auto v7 = 0.0f;
auto v8 = 0.f;
auto v10 = 0.0f;
auto v11 = v1;
if (v1 <= 1.0f) {
v4 = v10;
if (v1> = 0.0)
v4 = v11;
v3 = v4;
}
else
v3 = 1.0f;
auto v5 = ((float) thisptr) [41];
auto v6 = (float) ((float) ((float) (((float *) thisptr) [71] * -0.3f) - 2.0f) * v3) + 1.0f;
if (v5> 0.0) {
v7 = ((float *) thisptr) [63];
v11 = 0.0;
v10 = v7;
if (v7 <= 1.0f) {
v8 = v11;
if (v7> = 0.0)
v8 = v10;
v2 = v8;
}
v6 = v6 + (float) ((float) (v2 * v5) * (float) (0.5f - v6));
}
return ((float *) thisptr) [205] * v6;
};
__forceinline float GetMaxBodyRotation () {
C_BaseEntity * entity {};
auto animstate = uintptr_t (entity-> getplayranimstate ());
float
rate = 180,
duckammount = (float) (animstate + 0xA4),
speedfraction = std :: max (0.f, std :: min ((float) (animstate + 0xF8), 1.f)),
speedfactor = std :: max (0.f, std :: min (1.f, (float) (animstate + 0xFC)));
float
unk1 = (((float) (animstate + 0x11C) * -0.30000001) - 0.19999999) * speedfraction,
unk2 = unk1 + 1.f;
if (duckammount> 0)
unk2 + = ((duckammount * speedfactor) * (0.5f - unk2));
return (float) (animstate + 0x334) * unk2;
};
float lmao (float flAngle)
{
return ((360.0f / 65536.0f) * ((int32_t) (flAngle * (65536.0f / 360.0f)) & 65535));
}
float aproach (float flTarget, float flValue, float flSpeed)
{
float flAdjustedSpeed = flSpeed;
if (flAdjustedSpeed <0.0f)
{
flAdjustedSpeed * = -1.0f;
}
float flAngleModTarget = lmao (flTarget);
float flAngleModValue = lmao (flValue);
float flDelta = (flAngleModTarget - flAngleModValue);
if (flDelta> = -180.0f)
{
if (flDelta> = 180.0f)
{
flDelta - = 360.0f;
}
}
else
{
if (flDelta <= -180.0f)
{
flDelta + = 360.0f;
}
}
float flReturn;
if (flDelta <= flAdjustedSpeed)
{
if ((flAdjustedSpeed * -1.0f) <= flDelta)
{
flReturn = flAngleModTarget;
}
else
{
flReturn = (flAngleModValue - flAdjustedSpeed);
}
}
else
{
flReturn = (flAngleModValue + flAdjustedSpeed);
}
return flReturn;
}
void resolver ()
{
float speed {};
float flMaxMovementSpeed = 260.0f;
float flRunningSpeed = speed / (flMaxMovementSpeed * 0.520f);
float flYawModifier = (((entity-> AnimState222 () -> fraction * -0.3f) - 0.2f) * flRunningSpeed) + 1.0f;
float maxrot = GetMaxBodyRotation;
float value = 50.f;
int MissedShots [65];
int ShotsFired [65];
int ShotsHit [65];
MissedShots [entity-> EntIndex ()] = ShotsFired [entity-> EntIndex ()] - ShotsHit [entity-> EntIndex ()];
bool desync {};
CAnimationLayer * layer {};
float minbodyyaw {};
float maxbodyyaw {};
float flMinBodyYaw = std :: fabsf (minbodyyaw * flYawModifier);
float flMaxBodyYaw = std :: fabsf (maxbodyyaw * flYawModifier);
float Left = flEyeYaw + flMinBodyYaw;
float Right = flEyeYaw + flMaxBodyYaw;
float resolveYaw {};
float fakegoalfeetyaw {};
float flEyeYaw = entity-> m_angEyeAngles (). yaw;
float flEyeDiff = std :: remainderf (flEyeYaw - fakegoalfeetyaw, 360.f);
float chokedtime {};
if (flEyeDiff <= flMaxBodyYaw) {
if (flMinBodyYaw> flEyeDiff)
fakegoalfeetyaw = fabs (flMinBodyYaw) + flEyeYaw;
}
else {
fakegoalfeetyaw = flEyeYaw - fabs (flMaxBodyYaw);
}
fakegoalfeetyaw = std :: remainderf (fakegoalfeetyaw, 360.f);
if (speed> 0.1f) {
fakegoalfeetyaw = aproach (
flEyeYaw,
fakegoalfeetyaw,
((entity-> AnimState222 () -> fraction * 20.0f) + 30.0f)
* chokedtime);
}
else {
fakegoalfeetyaw = aproach (
entity-getlowerbodyyaw (),
fakegoalfeetyaw,
chokedtime * 100.0f);
}
if (desync == layers [3] .cycle == 0.f && layers [3] .weight == 0.f)
value = maxrot ;;
if (maxrot <value)
value = maxrot;
if (chokedpackets <1)
{
}
else
{
switch (MissedShots [entity-> EntIndex ()]% 2)
{
case 0:
entity-> AnimState222 () - goalfeetyaw () = flEyeYaw + get_max_desync_delta_aimware ();
break;
case 1:
entity-> AnimState222 () - goalfeetyaw () = flEyeYaw - get_max_desync_delta_aimware ();
break;
default:
break;
}
}
if (MissedShots [entity-> EntIndex ()])> 2)
{
float resolveYaw;
switch (MissedShots [entity-> EntIndex ()]% 3)
{
case 0: // brute left side
resolveYaw = Left;
break;
case 1: // brute fake side
resolveYaw = fakegoalfeetyaw;
break;
case 2: // brute right side
resolveYaw = Right;
break;
default:
break;
}
}
}