From 3d412a4b30a9f7c7f51ea6562e694315948bd3da Mon Sep 17 00:00:00 2001 From: boris Date: Wed, 28 Nov 2018 16:00:02 +1300 Subject: cleaned up in short, the cheat and loader are now separate solutions. unused stuff was moved into the legacy solution in case anyone wants to compile it or whatever. i can change this back if you want to. also, i configured the loader to compile in x64, and have separate build types for linux and win64 --- cheat/tf2/emit_sound.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 cheat/tf2/emit_sound.cpp (limited to 'cheat/tf2/emit_sound.cpp') diff --git a/cheat/tf2/emit_sound.cpp b/cheat/tf2/emit_sound.cpp new file mode 100644 index 0000000..b311b84 --- /dev/null +++ b/cheat/tf2/emit_sound.cpp @@ -0,0 +1,25 @@ +#include "base_cheat.h" +#include "hooks.h" +#include "settings.h" + +//eenie meenie miney moe i kepy this in here incase i wanted to ever do something with it i could fix it to match tf2's emitsound but yknow what? i prolly wont watadearhiugaer sorry i spilt water on my desk and smashed my face into the keyboard + +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 = cl.m_engine_sound->get_old_function< decltype( &hooks::emit_sound ) >( 5 ); + + if( !cl.m_panic && origin ) { + auto entity = cl.m_entlist( )->get_client_entity< c_base_player >( ent ); + if( entity && entity->is_player( ) && entity->ce( )->is_dormant( ) && + ent >= 0 && ent <= 64 ) + g_cheat.visuals.update_position( ent, *origin ); + } + + if( strstr( sample, xors( "weapon" ) ) && g_settings.misc.no_sound ) + volume = 0.f; + + 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 -- cgit v1.2.3