diff --git a/src/client/component/dvars_patches.cpp b/src/client/component/dvars_patches.cpp index 9972c029..e9a01a17 100644 --- a/src/client/component/dvars_patches.cpp +++ b/src/client/component/dvars_patches.cpp @@ -34,25 +34,20 @@ namespace dvars_patches { const auto update_ads_dof = a.newLabel(); - a.pushad64(); - a.push(rax); - a.mov(rax, qword_ptr(0x14AE95478_g)); // r_dof_enable + + a.test(rax, rax); + a.jz(update_ads_dof); + a.cmp(byte_ptr(rax, 0x28), 1); - a.pop(rax); a.je(update_ads_dof); - a.popad64(); a.jmp(0x141116ECB_g); a.bind(update_ads_dof); a.lea(rdx, ptr(rbx, 0x131EB4)); - a.mov(ecx, esi); - a.call_aligned(0x141107EC0_g); // CG_UpdateAdsDof - - a.popad64(); - a.jmp(0x141116F49_g); + a.jmp(0x141116EC2_g); // CG_UpdateAdsDof } } @@ -70,7 +65,7 @@ namespace dvars_patches } // toggle ADS dof based on r_dof_enable - //utils::hook::jump(0x141116EBB_g, utils::hook::assemble(dof_enabled_stub)); + utils::hook::jump(0x141116EBB_g, utils::hook::assemble(dof_enabled_stub)); } }; }