Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void __fastcall Hooks::DrawModelExecute(void* ecx, void* edx, IMatRenderContext* context, const DrawModelState_t& state, const ModelRenderInfo_t& info, matrix3x4_t* matrix)
- {
- static auto oDrawModelExecute = g_Hooks.pModelHook->GetOriginal<DrawModelExecute_t>(VT_Indexes::DrawModelExecute);
- static IMaterial* dogtag = g_MatSystem->FindMaterial("models/inventory_items/dogtags/dogtags_outline", TEXTURE_GROUP_OTHER);
- static IMaterial* arms = g_Chams.CreateMaterial(false, true, true);
- if (info.pModel)
- {
- std::string modelName = g_MdlInfo->GetModelName(info.pModel);
- if (g_Config.Visuals_ArmsChams && modelName.find("arms") != std::string::npos)
- {
- arms->AlphaModulate(g_Config.Visuals_ArmsChamsColor.clr[3]);
- g_pRenderView->ModulateColor(g_Config.Visuals_ArmsChamsColor);
- g_MdlRender->ForcedMaterialOverride(arms);
- oDrawModelExecute(ecx, context, state, info, matrix);
- g_MdlRender->ForcedMaterialOverride(nullptr);
- return;
- }
- }
- oDrawModelExecute(ecx, context, state, info, matrix);
- if (info.entity_index == G::pLocalPlayer->EntIndex() && (g_Config.Visuals_FakeAngleChams || g_Config.Visuals_FakeLagChams) && g_Config.AntiAim_Enabled)
- {
- Vector vBonePos, vOutPos;
- static matrix3x4_t LastNetworkedBoneMatrix[128];
- matrix3x4_t BoneMatrix[128];
- Vector delta = Vector(0.f, g_AntiAim.GetBestDesyncDelta(), 0.f);
- for (int i = 0; i < 128; i++)
- {
- g_Math.MatrixAngle(delta, BoneMatrix[i]);
- g_Math.MultiplyMatrix(BoneMatrix[i], matrix[i]);
- vBonePos = Vector(matrix[i][0][3], matrix[i][1][3], matrix[i][2][3]) - G::pLocalPlayer->GetAbsOrigin();
- g_Math.RotateVector(vBonePos, delta, vOutPos);
- vOutPos += G::pLocalPlayer->GetAbsOrigin();
- BoneMatrix[i][0][3] = vOutPos.x;
- BoneMatrix[i][1][3] = vOutPos.y;
- BoneMatrix[i][2][3] = vOutPos.z;
- }
- if (G::bSendPacket)
- {
- for(int i = 0; i < 128; i++) g_Math.MatrixCopy(BoneMatrix[i], LastNetworkedBoneMatrix[i]);
- }
- if (g_Config.Visuals_FakeAngleChams && g_Config.AntiAim_DesyncAA)
- {
- dogtag->AlphaModulate(g_Config.Visuals_FakeAngleChamsColor.clr[3]);
- g_pRenderView->ModulateColor(g_Config.Visuals_FakeAngleChamsColor);
- g_MdlRender->ForcedMaterialOverride(dogtag);
- oDrawModelExecute(ecx, context, state, info, BoneMatrix);
- }
- if (G::pLocalPlayer->GetVelocity().Length2D() > 1.f && g_Config.Misc_FakeLagLimit > 1.f && g_Config.Visuals_FakeLagChams)
- {
- dogtag->AlphaModulate(g_Config.Visuals_FakeLagChamsColor.clr[3]);
- g_pRenderView->ModulateColor(g_Config.Visuals_FakeLagChamsColor);
- g_MdlRender->ForcedMaterialOverride(dogtag);
- oDrawModelExecute(ecx, context, state, info, LastNetworkedBoneMatrix);
- }
- g_MdlRender->ForcedMaterialOverride(nullptr);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement