From 96de4961c447d7009ba52b6bf04d4b7bfe487ab1 Mon Sep 17 00:00:00 2001 From: boris Date: Wed, 28 Nov 2018 22:02:33 +1300 Subject: fixed emitsound hook --- cheat/internal_rewrite/emit_sound.cpp | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) (limited to 'cheat/internal_rewrite/emit_sound.cpp') diff --git a/cheat/internal_rewrite/emit_sound.cpp b/cheat/internal_rewrite/emit_sound.cpp index 13ae28a..de4962b 100644 --- a/cheat/internal_rewrite/emit_sound.cpp +++ b/cheat/internal_rewrite/emit_sound.cpp @@ -2,26 +2,28 @@ #include "hooks.hpp" #include "settings.hpp" -/*void __fastcall hooks::emit_sound( void* ecx_, void* edx_, void* filter, int ent, int channel, const char* sound, uint32_t hash, +void __fastcall hooks::emit_sound( void* ecx_, void* edx_, void* filter, int ent, int channel, const char* sound, uint32_t hash, const char* sample, float volume, float attenuation, int seed, int flags, int pitch, const vec3_t* origin, - const vec3_t* direction, vec3_t* origins, bool update_pos, float sound_time, int speaker_entry ) { - static auto emit_sound_o = g_csgo.m_engine_sound->get_old_function< decltype( &hooks::emit_sound ) >( 5 ); + const vec3_t* direction, vec3_t* origins, bool update_pos, float sound_time, int speaker_entry, void *unk01 ) { + //static auto emit_sound_o = g_csgo.m_engine_sound->get_old_function< decltype( &hooks::emit_sound ) >( 5 ); - if( !g_csgo.m_panic && origin ) { - auto entity = g_csgo.m_entlist( )->GetClientEntity< >( ent ); - if( entity && entity->is_player( ) && entity->ce( )->IsDormant( ) && - ent >= 0 && ent <= 64 ) - g_cheat.m_visuals.update_position( ent, *origin ); - } + // this is already implemented in visual_player.cpp + //if( !g_csgo.m_panic && origin ) { + // auto entity = g_csgo.m_entlist( )->GetClientEntity< >( ent ); + // if( entity && entity->is_player( ) && entity->ce( )->IsDormant( ) && + // ent >= 0 && ent <= 64 ) + // g_cheat.m_visuals.update_position( ent, *origin ); + //} - if( strstr( sample, xors( "weapon" ) ) && g_settings.misc.no_sound ) + if( g_settings.misc.no_sound && strstr( sample, xors( "weapon" ) ) ) volume = 0.f; - if( ( strstr( sample, xors( "player/footsteps" ) ) || strstr( sample, xors( "player/land" ) ) ) && origin && g_settings.visuals.sound ) { - g_cheat.m_visuals.store_sound( ent, *origin ); - } + // todo: fix this not being drawn + //if( g_settings.visuals.sound && ( strstr( sample, xors( "player/footsteps" ) ) || strstr( sample, xors( "player/land" ) ) ) && origin ) { + // g_cheat.m_visuals.store_sound( ent, *origin ); + //} emit_sound_o( ecx_, 0, filter, ent, channel, sound, hash, sample, volume, attenuation, seed, flags, pitch, origin, direction, - origins, update_pos, sound_time, speaker_entry ); -}*/ \ No newline at end of file + origins, update_pos, sound_time, speaker_entry, unk01 ); +} \ No newline at end of file -- cgit v1.2.3