Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- IMaterial* __stdcall Hooked_FindMaterial( char const* pMaterialName, const char *pTextureGroupName, bool complain = true, const char *pComplainPrefix = NULL )
- {
- g_FindMaterialHook.UnHook();
- IMaterial* ret = g_pMaterialSystem->FindMaterial( pMaterialName, pTextureGroupName, complain, pComplainPrefix );
- g_FindMaterialHook.ReHook();
- static int numHackedMaterials = 0;
- if( Q_strstr(pMaterialName, "models\\player") ||
- Q_strstr(pMaterialName, "models\\items") ||
- Q_strstr(pMaterialName, "models\\buildables") ||
- Q_strstr(pMaterialName, "particle") ||
- Q_strstr(pMaterialName, "Particles") )
- {
- if (ret->GetMaterialVarFlag(MATERIAL_VAR_NOFOG))
- return ret;
- ret->SetMaterialVarFlag(MATERIAL_VAR_IGNOREZ, true);
- ret->SetMaterialVarFlag(MATERIAL_VAR_ZNEARER, true);
- ret->SetMaterialVarFlag(MATERIAL_VAR_NOFOG, true);
- numHackedMaterials++;
- Msg("[MS] Material %s intercepted\n", pMaterialName);
- if (numHackedMaterials % 50 == 0)
- Msg("[MS] %d materials hacked", numHackedMaterials);
- }
- return ret;
- }
Advertisement
Add Comment
Please, Sign In to add comment