diff options
| author | JustSomePwner <crotchyalt@gmail.com> | 2018-08-30 14:01:54 +0200 |
|---|---|---|
| committer | JustSomePwner <crotchyalt@gmail.com> | 2018-08-30 14:01:54 +0200 |
| commit | 7ccb819f867493f8ec202ea3b39c94c198c64584 (patch) | |
| tree | 94622e61af0ff359e3d6689cf274d74f60b2492a /gmod/scene_end.cpp | |
| parent | 564d979b79e8a5aaa5014eba0ecd36c61575934f (diff) | |
first
Diffstat (limited to 'gmod/scene_end.cpp')
| -rw-r--r-- | gmod/scene_end.cpp | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/gmod/scene_end.cpp b/gmod/scene_end.cpp new file mode 100644 index 0000000..1e42543 --- /dev/null +++ b/gmod/scene_end.cpp @@ -0,0 +1,43 @@ +#include "hooks.hpp"
+#include "settings.hpp"
+#include "base_cheat.hpp"
+#include "context.hpp"
+
+void __fastcall hooks::scene_end( void* ecx_, void* edx_ ) {
+ static auto scene_end_o = g_csgo.m_render_view->get_old_function< decltype( &hooks::scene_end ) >( 9 );
+ scene_end_o( edx_, 0 );
+
+ if( !g_csgo.m_panic && g_ctx.m_local && g_settings.visuals.chams.enabled( ) && g_settings.visuals.chams.ignore_z( ) ) {
+ g_ctx.m_drawing_screneend = true;
+ for( int i = 1; i < g_csgo.m_globals->m_maxclients; ++i ) {
+ auto ent = g_csgo.m_entlist( )->GetClientEntity< >( i );
+
+ if( ent && ent->is_valid( ) && !ent->m_bGunGameImmunity( ) ) {
+ if( ent == g_ctx.m_local && ent->m_bIsScoped( ) ) {
+ continue;
+ }
+
+ int team = ent->m_iTeamNum( );
+ bool enemy = team != g_ctx.m_local->m_iTeamNum( );
+
+ if( enemy || g_settings.visuals.chams.friendlies( ) ) {
+ IMaterial* mat = g_settings.visuals.chams.flat ? g_cheat.m_chams.m_materials.m_chams_flat : g_cheat.m_chams.m_materials.m_chams;
+ fclr_t clr_vis = enemy ? g_settings.visuals.chams.color_visible_enemy( ).to_fclr( ) : g_settings.visuals.chams.color_visible_friendly( ).to_fclr( );
+ fclr_t clr_hid = enemy ? g_settings.visuals.chams.color_hidden_enemy( ).to_fclr( ) : g_settings.visuals.chams.color_hidden_friendly( ).to_fclr( );
+
+ mat->SetMaterialVarFlag( MATERIAL_VAR_IGNOREZ, true );
+ g_cheat.m_chams.m_materials.force_material( mat, clr_hid );
+ ent->ce( )->DrawModel( 0x1, 255 );
+
+ mat->SetMaterialVarFlag( MATERIAL_VAR_IGNOREZ, false );
+ g_cheat.m_chams.m_materials.force_material( mat, clr_vis );
+ ent->ce( )->DrawModel( 0x1, 255 );
+
+ g_csgo.m_model_render( )->ForcedMaterialOverride( nullptr );
+ }
+ }
+ }
+
+ g_ctx.m_drawing_screneend = false;
+ }
+}
\ No newline at end of file |
