Fix dof hook

This commit is contained in:
momo5502 2023-03-17 19:53:10 +01:00
parent 71009dd628
commit b5d30563af

View File

@ -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));
}
};
}