You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// we store this here so we don't have to hardcode another address that
41
+
// needs to be updated with each new game patch
42
+
plWorkGlobal = plWork;
21
43
22
-
if (CamoIndexData != NULL)
44
+
int* result = ActionSquatStill(work, plWork, a3, a4);
45
+
int16_t padForce = *(int16_t*)(work + 2016);
46
+
47
+
CrouchMoving = padForce > plWork->padForceLimit;
48
+
49
+
// 0xDE seems to make sure we aren't in first person mode
50
+
if (CrouchMoving && !PlayerStatusCheck(0xDE))
51
+
{
52
+
if (!CrouchWalkEnabled)
53
+
plWork->motion = PlayerSetMotion(work, PlayerMotion::RunUpwards); // we must set the motion to something unusable on the first run, otherwise the anim won't reset properly
54
+
else
55
+
plWork->motion = PlayerSetMotion(work, PlayerMotion::StandMoveStalk); // hijack the stalking motion
56
+
57
+
CrouchWalkEnabled = true;
58
+
}
59
+
60
+
if (CrouchWalkEnabled && (plWork->flag & MovementFlag::FlagStand) != 0)
61
+
CrouchWalkEnabled = false;
62
+
63
+
return result;
64
+
}
65
+
66
+
void __fastcall SetMotionDataHook(int* m_ctrl, int layer, PlayerMotion motion, int time, __int64 a5)
67
+
{
68
+
if (motion == PlayerMotion::StandMoveStalk && CrouchWalkEnabled)
69
+
motion = PlayerMotion::SquatMove;
70
+
71
+
SetMotionData(m_ctrl, layer, motion, time, a5);
72
+
}
73
+
74
+
__int64 __fastcall ActMovementHook(MovementWork* plWork, __int64 work, int flag)
75
+
{
76
+
if (plWorkGlobal != NULL && plWorkGlobal->action != ActSquatStillOffset)
77
+
CrouchWalkEnabled = false;
78
+
79
+
returnActMovement(plWork, work, flag);
80
+
}
81
+
82
+
int* __fastcall CalculateCamoIndexHook(int* a1, int a2)
83
+
{
84
+
int* result = CalculateCamoIndex(a1, a2);
85
+
86
+
if (CamoIndexData != NULL && CrouchWalkEnabled)
23
87
{
24
88
int index = a2 << 7;
25
89
auto camoIndex = (int*)((char*)&CamoIndexData[4] + index + 4);
26
90
auto movementState = (int*)((char*)&CamoIndexData[4] + index + 8);
27
91
28
-
if (*camoIndex >= 1000) // ignore if stealth is equipped
92
+
if (*camoIndex >= 1000) // ignore if stealth is equipped (todo: properly check item for ezgun and spider camo)
0 commit comments