diff options
| author | boris <wzn@moneybot.cc> | 2018-11-28 16:00:02 +1300 |
|---|---|---|
| committer | boris <wzn@moneybot.cc> | 2018-11-28 16:00:02 +1300 |
| commit | 3d412a4b30a9f7c7f51ea6562e694315948bd3da (patch) | |
| tree | 26d67dfd1f3e5fd12903ad13e85d0cb8bcf8f21c /cheat/internal_rewrite/play_sound.cpp | |
| parent | e4729e4393d90271a3814c7a79950a660c48325a (diff) | |
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
Diffstat (limited to 'cheat/internal_rewrite/play_sound.cpp')
| -rw-r--r-- | cheat/internal_rewrite/play_sound.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/cheat/internal_rewrite/play_sound.cpp b/cheat/internal_rewrite/play_sound.cpp new file mode 100644 index 0000000..542be24 --- /dev/null +++ b/cheat/internal_rewrite/play_sound.cpp @@ -0,0 +1,31 @@ +#include "hooks.hpp" +#include "base_cheat.hpp" +void __fastcall hooks::play_sound( void* ecx_, void*, const char* file ) { +#ifdef HEADER_MODULE + // static auto is_ready = g_header.patterns.is_ready; + static auto is_ready = pattern::first_code_match( g_csgo.m_chl.dll( ), xors( "55 8B EC 83 E4 F8 83 EC 08 56 8B 35 00 00 00 00 57 83 BE" ), 0 ); +#else + static auto is_ready = pattern::first_code_match( g_csgo.m_chl.dll( ), xors( "55 8B EC 83 E4 F8 83 EC 08 56 8B 35 00 00 00 00 57 83 BE" ), 0 ); +#endif + static bool was_played = false; + static float played_tick = 0.f; + + play_sound_o( ecx_, 0, file ); + + if( !g_settings.misc.auto_accept || g_csgo.m_engine( )->IsInGame( ) ) { + was_played = false; + return; + } + + if( strstr( file, xors( "competitive_accept_beep.wav" ) ) && !was_played ) { + was_played = true; + played_tick = GetTickCount( ) * 0.001f + g_settings.misc.auto_accept_delay; + g_cheat.m_extra.server_information( ); + g_cheat.m_visuals.reset_local_dmg( ); + } + + if( was_played && GetTickCount( ) * 0.001f > played_tick ) { + reinterpret_cast< void( __cdecl* )( ) >( is_ready )( ); + was_played = false; + } +}
\ No newline at end of file |
