summaryrefslogtreecommitdiff
path: root/gmod/emit_sound.cpp
diff options
context:
space:
mode:
authorJustSomePwner <crotchyalt@gmail.com>2018-08-30 14:01:54 +0200
committerJustSomePwner <crotchyalt@gmail.com>2018-08-30 14:01:54 +0200
commit7ccb819f867493f8ec202ea3b39c94c198c64584 (patch)
tree94622e61af0ff359e3d6689cf274d74f60b2492a /gmod/emit_sound.cpp
parent564d979b79e8a5aaa5014eba0ecd36c61575934f (diff)
first
Diffstat (limited to 'gmod/emit_sound.cpp')
-rw-r--r--gmod/emit_sound.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/gmod/emit_sound.cpp b/gmod/emit_sound.cpp
new file mode 100644
index 0000000..547828c
--- /dev/null
+++ b/gmod/emit_sound.cpp
@@ -0,0 +1,19 @@
+#include "base_cheat.hpp"
+#include "hooks.hpp"
+
+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 );
+
+ 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 );
+ }
+
+ 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