@@ -28,6 +28,7 @@ ActionSquatStillDelegate* ActionSquatStill;
2828PlayerSetMotionDelegate* PlayerSetMotionInternal;
2929SetMotionDataDelegate* SetMotionData;
3030PlayerStatusCheckDelegate* PlayerStatusCheck;
31+ PlayerStatusSetDelegate* PlayerStatusSet;
3132ActMovementDelegate* ActMovement;
3233GetButtonHoldingStateDelegate* GetButtonHoldingState;
3334
@@ -133,16 +134,18 @@ int* __fastcall ActionSquatStillHook(int64_t work, MovementWork* plWork, int64_t
133134 {
134135 mCtrlGlobal->mtcmControl->motionTimeBase = CrouchMovingSlow ? CrouchStalkSpeed : CrouchWalkSpeed;
135136
136- auto mtsq_cntrl = *((uintptr_t*)(uintptr_t) mCtrlGlobal + 15);
137+ auto mtsq_cntrl = *((uintptr_t*)mCtrlGlobal + 15);
137138 auto sound = (uint8_t*)mtsq_cntrl + 0x3C;
138139 auto soundType = (uint8_t*)mtsq_cntrl + 0x48;
139- auto soundLevel = (uint8_t*)mtsq_cntrl + 0x40;
140+ auto motionId = (uint8_t*)mtsq_cntrl + 0x40;
140141
141142 *sound = 5;
142- *soundType = CrouchMovingSlow ? 0x20 : 0x40 ;
143- *soundLevel = CrouchMovingSlow ? 12 : 150 ;
143+ *soundType = CrouchMovingSlow ? 0x40 : 0x60 ;
144+ *motionId = CrouchMovingSlow ? PlayerMotion::StandMoveStalk : PlayerMotion::StandMoveSlow ;
144145 }
145146
147+ PlayerStatusSet(11, 14, 0x10C, 0xFFFFFFFF); // enables grass movement sounds
148+
146149 CrouchWalkEnabled = true;
147150 }
148151
@@ -166,6 +169,7 @@ void InstallHooks()
166169 InitializeCamoIndex = (InitializeCamoIndexDelegate*)Memory::PatternScan(GameModule, "85 D2 75 33 0F 57 C0 48 63 C2 48 C1 E0 07 48 8D");
167170 PlayerSetMotionInternal = (PlayerSetMotionDelegate*)(Memory::PatternScan(GameModule, "B9 0F 01 00 00 E8 ?? 36 FF FF 85 C0 74 2A BA FF") - 0x10);
168171 PlayerStatusCheck = (PlayerStatusCheckDelegate*)Memory::PatternScan(GameModule, "8B D1 B8 01 00 00 00 83 E1 1F D3 E0 8B CA 48 C1");
172+ PlayerStatusSet = (PlayerStatusSetDelegate*)(Memory::PatternScan(GameModule, "04 89 0F AB D0 41 89 04") - 0x46);
169173
170174 Memory::DetourFunction(actMovementOffset, (LPVOID)ActMovementHook, (LPVOID*)&ActMovement);
171175 Memory::DetourFunction(setMotionDataOffset, (LPVOID)SetMotionDataHook, (LPVOID*)&SetMotionData);
0 commit comments