From c1f1c5a4c977fbd19d0ca42338e9be1cabd3cb90 Mon Sep 17 00:00:00 2001 From: bencat07 Date: Sun, 26 May 2019 12:07:58 +0200 Subject: [PATCH] Add lots of more cotiring --- CMakeLists.txt | 7 +++++-- src/CMakeLists.txt | 6 ++++-- src/PlayerTools.cpp | 6 +++--- src/chatlog.cpp | 5 ++--- src/classinfo/CMakeLists.txt | 10 ++++++---- src/copypasted/CMakeLists.txt | 8 +++++--- src/core/CMakeLists.txt | 20 +++++++++++--------- src/crits.cpp | 23 +++++++++++------------ src/hacks/AutoDeadringer.cpp | 4 ++-- src/hacks/CMakeLists.txt | 6 ++++-- src/hacks/ac/CMakeLists.txt | 10 ++++++---- src/hacks/ac/aimbot.cpp | 5 ++--- src/hacks/ac/antiaim.cpp | 3 +-- src/hacks/ac/bhop.cpp | 3 +-- src/hooks/DispatchUserMessage.cpp | 3 +-- src/hooks/nographics.cpp | 2 +- src/hoovy.cpp | 2 +- src/ipc.cpp | 3 ++- src/itemtypes.cpp | 2 +- src/projlogging.cpp | 3 ++- src/reclasses/CMakeLists.txt | 18 ++++++++++-------- src/sdk/CMakeLists.txt | 22 ++++++++++++---------- src/settings/CMakeLists.txt | 15 +++++++++------ src/textmode.cpp | 2 +- src/votelogger.cpp | 10 +++------- 25 files changed, 106 insertions(+), 92 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index aefb323f..bbf9b0f6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -165,11 +165,14 @@ add_subdirectory(modules) if (EnableCotire) set_target_properties(cathook PROPERTIES COTIRE_CXX_PREFIX_HEADER_INIT "${CMAKE_SOURCE_DIR}/include/common.hpp") set_target_properties(cathook PROPERTIES COTIRE_ADD_UNITY_BUILD true) + set_target_properties(cathook PROPERTIES COTIRE_UNITY_SOURCE_MAXIMUM_NUMBER_OF_INCLUDES 30) set_source_files_properties(${ignore_files} PROPERTIES COTIRE_EXCLUDED true) cotire(cathook) endif() add_custom_command(TARGET cathook POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ "${CMAKE_SOURCE_DIR}/bin/$") -add_custom_command(TARGET cathook_unity POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy $ "${CMAKE_SOURCE_DIR}/bin/$") +if (EnableCotire) + add_custom_command(TARGET cathook_unity POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy $ "${CMAKE_SOURCE_DIR}/bin/$") +endif() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 80250000..4d85a600 100755 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,5 +1,4 @@ -target_sources(cathook PRIVATE - "${CMAKE_CURRENT_LIST_DIR}/angles.cpp" +set(files "${CMAKE_CURRENT_LIST_DIR}/angles.cpp" "${CMAKE_CURRENT_LIST_DIR}/chatlog.cpp" "${CMAKE_CURRENT_LIST_DIR}/chatstack.cpp" "${CMAKE_CURRENT_LIST_DIR}/conditions.cpp" @@ -35,6 +34,9 @@ target_sources(cathook PRIVATE "${CMAKE_CURRENT_LIST_DIR}/irc.cpp" "${CMAKE_CURRENT_LIST_DIR}/PlayerTools.cpp") +target_sources(cathook PRIVATE ${files}) +list(REMOVE_ITEM ignore_files ${files}) +set(ignore_files ${ignore_files} CACHE INTERNAL "") add_subdirectory(core) add_subdirectory(classinfo) add_subdirectory(copypasted) diff --git a/src/PlayerTools.cpp b/src/PlayerTools.cpp index d84d2b38..3fcbdfa1 100644 --- a/src/PlayerTools.cpp +++ b/src/PlayerTools.cpp @@ -11,6 +11,9 @@ #include "entitycache.hpp" #include "settings/Bool.hpp" +namespace player_tools +{ + static settings::Int betrayal_limit{ "player-tools.betrayal-limit", "2" }; static settings::Bool taunting{ "player-tools.ignore.taunting", "true" }; @@ -26,9 +29,6 @@ static std::unordered_map betrayal_list{}; static CatCommand forgive_all("pt_forgive_all", "Clear betrayal list", []() { betrayal_list.clear(); }); -namespace player_tools -{ - bool shouldTargetSteamId(unsigned id) { if (betrayal_limit) diff --git a/src/chatlog.cpp b/src/chatlog.cpp index 9d7ce484..758eea7a 100644 --- a/src/chatlog.cpp +++ b/src/chatlog.cpp @@ -13,13 +13,12 @@ #include #include +namespace chatlog +{ static settings::Bool enable{ "chat-log.enable", "false" }; static settings::Bool no_spam{ "chat-log.no-spam", "true" }; static settings::Bool no_ipc{ "chat-log.no-ipc", "true" }; -namespace chatlog -{ - class csv_stream { public: diff --git a/src/classinfo/CMakeLists.txt b/src/classinfo/CMakeLists.txt index 5d82ad42..be3b76bd 100755 --- a/src/classinfo/CMakeLists.txt +++ b/src/classinfo/CMakeLists.txt @@ -1,4 +1,6 @@ -target_sources(cathook PRIVATE - "${CMAKE_CURRENT_LIST_DIR}/classinfo.cpp" - "${CMAKE_CURRENT_LIST_DIR}/dump.cpp" - "${CMAKE_CURRENT_LIST_DIR}/dynamic.gen.cpp") \ No newline at end of file +set(files "${CMAKE_CURRENT_LIST_DIR}/classinfo.cpp" + "${CMAKE_CURRENT_LIST_DIR}/dump.cpp" + "${CMAKE_CURRENT_LIST_DIR}/dynamic.gen.cpp") +target_sources(cathook PRIVATE ${files}) +list(REMOVE_ITEM ignore_files ${files}) +set(ignore_files ${ignore_files} CACHE INTERNAL "") diff --git a/src/copypasted/CMakeLists.txt b/src/copypasted/CMakeLists.txt index 101f70e8..79b240a5 100755 --- a/src/copypasted/CMakeLists.txt +++ b/src/copypasted/CMakeLists.txt @@ -1,3 +1,5 @@ -target_sources(cathook PRIVATE - "${CMAKE_CURRENT_LIST_DIR}/CSignature.cpp" - "${CMAKE_CURRENT_LIST_DIR}/Netvar.cpp") \ No newline at end of file +set(files "${CMAKE_CURRENT_LIST_DIR}/CSignature.cpp" + "${CMAKE_CURRENT_LIST_DIR}/Netvar.cpp") +target_sources(cathook PRIVATE ${files}) +list(REMOVE_ITEM ignore_files ${files}) +set(ignore_files ${ignore_files} CACHE INTERNAL "") diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 181b086c..0bde8182 100755 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -1,9 +1,11 @@ -target_sources(cathook PRIVATE - "${CMAKE_CURRENT_LIST_DIR}/cvwrapper.cpp" - "${CMAKE_CURRENT_LIST_DIR}/entry.cpp" - "${CMAKE_CURRENT_LIST_DIR}/init.cpp" - "${CMAKE_CURRENT_LIST_DIR}/interfaces.cpp" - "${CMAKE_CURRENT_LIST_DIR}/logging.cpp" - "${CMAKE_CURRENT_LIST_DIR}/netvars.cpp" - "${CMAKE_CURRENT_LIST_DIR}/profiler.cpp" - "${CMAKE_CURRENT_LIST_DIR}/sharedobj.cpp") \ No newline at end of file +set(files "${CMAKE_CURRENT_LIST_DIR}/cvwrapper.cpp" + "${CMAKE_CURRENT_LIST_DIR}/entry.cpp" + "${CMAKE_CURRENT_LIST_DIR}/init.cpp" + "${CMAKE_CURRENT_LIST_DIR}/interfaces.cpp" + "${CMAKE_CURRENT_LIST_DIR}/logging.cpp" + "${CMAKE_CURRENT_LIST_DIR}/netvars.cpp" + "${CMAKE_CURRENT_LIST_DIR}/profiler.cpp" + "${CMAKE_CURRENT_LIST_DIR}/sharedobj.cpp") +target_sources(cathook PRIVATE ${files}) +list(REMOVE_ITEM ignore_files ${files}) +set(ignore_files ${ignore_files} CACHE INTERNAL "") diff --git a/src/crits.cpp b/src/crits.cpp index 84101dc9..90f54a29 100644 --- a/src/crits.cpp +++ b/src/crits.cpp @@ -8,17 +8,17 @@ #include #include "common.hpp" +std::unordered_map command_number_mod{}; + +namespace criticals +{ + static settings::Bool crit_info{ "crit.info", "false" }; static settings::Button crit_key{ "crit.key", "" }; static settings::Bool crit_melee{ "crit.melee", "false" }; static settings::Bool crit_legiter{ "crit.force-gameplay", "false" }; static settings::Bool crit_experimental{ "crit.experimental", "false" }; -std::unordered_map command_number_mod{}; - -namespace criticals -{ - int find_next_random_crit_for_weapon(IClientEntity *weapon) { int tries = 0, number = current_user_cmd->command_number, found = 0, seed_backup; @@ -224,6 +224,12 @@ void draw() } } #endif +static InitRoutine init([]() { + EC::Register(EC::CreateMove, criticals::create_move, "cm_crits", EC::very_late); +#if ENABLE_VISUALS + EC::Register(EC::Draw, criticals::draw, "draw_crits"); +#endif +}); } // namespace criticals void crithack_saved_state::Load(IClientEntity *entity) @@ -247,10 +253,3 @@ void crithack_saved_state::Save(IClientEntity *entity) seed2876 = *(int *) (uintptr_t(entity) + 2876); unknown2839 = *(char *) (uintptr_t(entity) + 2839); } - -static InitRoutine init([]() { - EC::Register(EC::CreateMove, criticals::create_move, "cm_crits", EC::very_late); -#if ENABLE_VISUALS - EC::Register(EC::Draw, criticals::draw, "draw_crits"); -#endif -}); diff --git a/src/hacks/AutoDeadringer.cpp b/src/hacks/AutoDeadringer.cpp index 0ebdc9a6..b16a2056 100644 --- a/src/hacks/AutoDeadringer.cpp +++ b/src/hacks/AutoDeadringer.cpp @@ -60,9 +60,9 @@ static void CreateMove() continue; if (ent->m_Type() != ENTITY_PROJECTILE) continue; - if (ent->m_bCritProjectile() && ent->m_flDistance() <= 1000.0f) + if (ent->m_bCritProjectile() && ent->m_flDistance() <= 500.0f) current_user_cmd->buttons |= IN_ATTACK2; - else if (ent->m_flDistance() < 300.0f) + else if (ent->m_flDistance() < 100.0f) current_user_cmd->buttons |= IN_ATTACK2; } } diff --git a/src/hacks/CMakeLists.txt b/src/hacks/CMakeLists.txt index be39de03..67affca1 100755 --- a/src/hacks/CMakeLists.txt +++ b/src/hacks/CMakeLists.txt @@ -40,8 +40,7 @@ set(ignore_files ${ignore_files} CACHE INTERNAL "") add_subdirectory(ac) if(EnableVisuals) - target_sources(cathook PRIVATE - "${CMAKE_CURRENT_LIST_DIR}/DominateMark.cpp" + set(files "${CMAKE_CURRENT_LIST_DIR}/DominateMark.cpp" "${CMAKE_CURRENT_LIST_DIR}/ESP.cpp" "${CMAKE_CURRENT_LIST_DIR}/Tracers.cpp" "${CMAKE_CURRENT_LIST_DIR}/Radar.cpp" @@ -49,4 +48,7 @@ if(EnableVisuals) "${CMAKE_CURRENT_LIST_DIR}/SpyAlert.cpp" "${CMAKE_CURRENT_LIST_DIR}/Thirdperson.cpp" "${CMAKE_CURRENT_LIST_DIR}/MCHealthbar.cpp") + target_sources(cathook PRIVATE ${files}) + list(REMOVE_ITEM ignore_files ${files}) + set(ignore_files ${ignore_files} CACHE INTERNAL "") endif() diff --git a/src/hacks/ac/CMakeLists.txt b/src/hacks/ac/CMakeLists.txt index a41b8f5c..be889953 100755 --- a/src/hacks/ac/CMakeLists.txt +++ b/src/hacks/ac/CMakeLists.txt @@ -1,4 +1,6 @@ -target_sources(cathook PRIVATE - "${CMAKE_CURRENT_LIST_DIR}/aimbot.cpp" - "${CMAKE_CURRENT_LIST_DIR}/antiaim.cpp" - "${CMAKE_CURRENT_LIST_DIR}/bhop.cpp") \ No newline at end of file +set(files "${CMAKE_CURRENT_LIST_DIR}/aimbot.cpp" + "${CMAKE_CURRENT_LIST_DIR}/antiaim.cpp" + "${CMAKE_CURRENT_LIST_DIR}/bhop.cpp") +target_sources(cathook PRIVATE ${files}) +list(REMOVE_ITEM ignore_files ${files}) +set(ignore_files ${ignore_files} CACHE INTERNAL "") diff --git a/src/hacks/ac/aimbot.cpp b/src/hacks/ac/aimbot.cpp index ec93a36e..f65887a7 100644 --- a/src/hacks/ac/aimbot.cpp +++ b/src/hacks/ac/aimbot.cpp @@ -10,13 +10,12 @@ #include #include "common.hpp" +namespace ac::aimbot +{ static settings::Bool enable{ "find-cheaters.aimbot.enable", "true" }; static settings::Float detect_angle{ "find-cheaters.aimbot.angle", "30" }; static settings::Int detections_warning{ "find-cheaters.aimbot.detections", "3" }; -namespace ac::aimbot -{ - ac_data data_table[32]; int amount[32]; std::unordered_map Player_origs{}; diff --git a/src/hacks/ac/antiaim.cpp b/src/hacks/ac/antiaim.cpp index 4578e486..d3c469d6 100644 --- a/src/hacks/ac/antiaim.cpp +++ b/src/hacks/ac/antiaim.cpp @@ -9,10 +9,9 @@ #include #include "common.hpp" -static settings::Bool enable{ "find-cheaters.antiaim.enable", "true" }; - namespace ac::antiaim { +static settings::Bool enable{ "find-cheaters.antiaim.enable", "true" }; unsigned long last_accusation[32]{ 0 }; diff --git a/src/hacks/ac/bhop.cpp b/src/hacks/ac/bhop.cpp index 05ac1ba8..1b4f2cc0 100644 --- a/src/hacks/ac/bhop.cpp +++ b/src/hacks/ac/bhop.cpp @@ -9,10 +9,9 @@ #include #include "common.hpp" -static settings::Int bhop_detect_count{ "find-cheaters.bunnyhop.detections", "4" }; - namespace ac::bhop { +static settings::Int bhop_detect_count{ "find-cheaters.bunnyhop.detections", "4" }; ac_data data_table[32]{}; diff --git a/src/hooks/DispatchUserMessage.cpp b/src/hooks/DispatchUserMessage.cpp index 60faf914..3611734f 100644 --- a/src/hooks/DispatchUserMessage.cpp +++ b/src/hooks/DispatchUserMessage.cpp @@ -20,7 +20,6 @@ static settings::Bool answerIdentify{ "chat.identify.answer", "false" }; static settings::Bool anti_votekick{ "cat-bot.anti-autobalance", "false" }; static bool retrun = false; -static Timer sendmsg{}; static Timer gitgud{}; // Using repeated char causes crash on some systems. Suboptimal solution. @@ -36,7 +35,7 @@ std::string lastname{}; namespace hooked_methods { - +static Timer sendmsg{}; template void SplitName(std::vector &ret, const T &name, int num) { T tmp; diff --git a/src/hooks/nographics.cpp b/src/hooks/nographics.cpp index c0fa97ba..c17b0a35 100755 --- a/src/hooks/nographics.cpp +++ b/src/hooks/nographics.cpp @@ -57,7 +57,7 @@ static CatCommand RemoveNullhook("debug_material_hook_clear", "Debug", []() { Re static settings::Bool debug_framerate("debug.framerate", "false"); static float framerate = 0.0f; static Timer send_timer{}; -static InitRoutine init([]() { +static InitRoutine init_nographics([]() { #if !ENABLE_VISUALS NullHook(); #endif diff --git a/src/hoovy.cpp b/src/hoovy.cpp index 7ace7d68..336a7325 100644 --- a/src/hoovy.cpp +++ b/src/hoovy.cpp @@ -69,4 +69,4 @@ bool IsHoovy(CachedEntity *entity) return hoovy_list[entity->m_IDX - 1]; } -static InitRoutine init([]() { EC::Register(EC::CreateMove, UpdateHoovyList, "cm_hoovylist", EC::average); }); +static InitRoutine init_heavy([]() { EC::Register(EC::CreateMove, UpdateHoovyList, "cm_hoovylist", EC::average); }); diff --git a/src/ipc.cpp b/src/ipc.cpp index ad4c3a72..28c5927d 100644 --- a/src/ipc.cpp +++ b/src/ipc.cpp @@ -16,11 +16,12 @@ #if ENABLE_IPC static settings::Bool ipc_update_list{ "ipc.update-player-list", "true" }; -static settings::String server_name{ "ipc.server", "cathook_followbot_server" }; namespace ipc { +static settings::String server_name{ "ipc.server", "cathook_followbot_server" }; + CatCommand fix_deadlock("ipc_fix_deadlock", "Fix deadlock", []() { if (peer) { diff --git a/src/itemtypes.cpp b/src/itemtypes.cpp index e848f737..a9b66aaa 100644 --- a/src/itemtypes.cpp +++ b/src/itemtypes.cpp @@ -219,7 +219,7 @@ k_EItemType ItemModelMapper::GetItemType(CachedEntity *entity) } ItemManager g_ItemManager; -static InitRoutine init([]() { +static InitRoutine init_itemtypes([]() { EC::Register( EC::LevelInit, []() { g_ItemManager = ItemManager{}; }, "clear_itemtypes"); }); diff --git a/src/projlogging.cpp b/src/projlogging.cpp index 01aeb288..20995b16 100644 --- a/src/projlogging.cpp +++ b/src/projlogging.cpp @@ -8,9 +8,10 @@ #include "projlogging.hpp" #include "common.hpp" -Vector prevloc[2048]{}; namespace projectile_logging { +Vector prevloc[2048]{}; + void Update() { for (int i = 1; i < HIGHEST_ENTITY; i++) diff --git a/src/reclasses/CMakeLists.txt b/src/reclasses/CMakeLists.txt index 166e19df..16313218 100755 --- a/src/reclasses/CMakeLists.txt +++ b/src/reclasses/CMakeLists.txt @@ -1,8 +1,10 @@ -target_sources(cathook PRIVATE - "${CMAKE_CURRENT_LIST_DIR}/C_MannVsMachineStats.cpp" - "${CMAKE_CURRENT_LIST_DIR}/CTFInventoryManager.cpp" - "${CMAKE_CURRENT_LIST_DIR}/CTFPartyClient.cpp" - "${CMAKE_CURRENT_LIST_DIR}/CTFParty.cpp" - "${CMAKE_CURRENT_LIST_DIR}/CTFGCClientSystem.cpp" - "${CMAKE_CURRENT_LIST_DIR}/C_TEFireBullets.cpp" - "${CMAKE_CURRENT_LIST_DIR}/ITFGroupMatchCriteria.cpp") \ No newline at end of file +set(files "${CMAKE_CURRENT_LIST_DIR}/C_MannVsMachineStats.cpp" + "${CMAKE_CURRENT_LIST_DIR}/CTFInventoryManager.cpp" + "${CMAKE_CURRENT_LIST_DIR}/CTFPartyClient.cpp" + "${CMAKE_CURRENT_LIST_DIR}/CTFParty.cpp" + "${CMAKE_CURRENT_LIST_DIR}/CTFGCClientSystem.cpp" + "${CMAKE_CURRENT_LIST_DIR}/C_TEFireBullets.cpp" + "${CMAKE_CURRENT_LIST_DIR}/ITFGroupMatchCriteria.cpp") +target_sources(cathook PRIVATE ${files}) +list(REMOVE_ITEM ignore_files ${files}) +set(ignore_files ${ignore_files} CACHE INTERNAL "") diff --git a/src/sdk/CMakeLists.txt b/src/sdk/CMakeLists.txt index e986c91d..ffb6c189 100755 --- a/src/sdk/CMakeLists.txt +++ b/src/sdk/CMakeLists.txt @@ -1,10 +1,12 @@ -target_sources(cathook PRIVATE - "${CMAKE_CURRENT_LIST_DIR}/checksum_md5.cpp" - "${CMAKE_CURRENT_LIST_DIR}/convar.cpp" - "${CMAKE_CURRENT_LIST_DIR}/HUD.cpp" - "${CMAKE_CURRENT_LIST_DIR}/KeyValues.cpp" - "${CMAKE_CURRENT_LIST_DIR}/MaterialSystemUtil.cpp" - "${CMAKE_CURRENT_LIST_DIR}/tier1.cpp" - "${CMAKE_CURRENT_LIST_DIR}/utlbuffer.cpp" - "${CMAKE_CURRENT_LIST_DIR}/UtlString.cpp" - "${CMAKE_CURRENT_LIST_DIR}/netmessage.cpp") \ No newline at end of file +set(files "${CMAKE_CURRENT_LIST_DIR}/checksum_md5.cpp" + "${CMAKE_CURRENT_LIST_DIR}/convar.cpp" + "${CMAKE_CURRENT_LIST_DIR}/HUD.cpp" + "${CMAKE_CURRENT_LIST_DIR}/KeyValues.cpp" + "${CMAKE_CURRENT_LIST_DIR}/MaterialSystemUtil.cpp" + "${CMAKE_CURRENT_LIST_DIR}/tier1.cpp" + "${CMAKE_CURRENT_LIST_DIR}/utlbuffer.cpp" + "${CMAKE_CURRENT_LIST_DIR}/UtlString.cpp" + "${CMAKE_CURRENT_LIST_DIR}/netmessage.cpp") +target_sources(cathook PRIVATE ${files}) +list(REMOVE_ITEM ignore_files ${files}) +set(ignore_files ${ignore_files} CACHE INTERNAL "") diff --git a/src/settings/CMakeLists.txt b/src/settings/CMakeLists.txt index 6a5966b0..c12c36ca 100755 --- a/src/settings/CMakeLists.txt +++ b/src/settings/CMakeLists.txt @@ -1,6 +1,9 @@ -target_sources(cathook PRIVATE - "${CMAKE_CURRENT_LIST_DIR}/Manager.cpp" - "${CMAKE_CURRENT_LIST_DIR}/Registered.cpp" - "${CMAKE_CURRENT_LIST_DIR}/Settings.cpp" - "${CMAKE_CURRENT_LIST_DIR}/SettingCommands.cpp" - "${CMAKE_CURRENT_LIST_DIR}/SettingsIO.cpp") \ No newline at end of file +set(files "${CMAKE_CURRENT_LIST_DIR}/Manager.cpp" + "${CMAKE_CURRENT_LIST_DIR}/Registered.cpp" + "${CMAKE_CURRENT_LIST_DIR}/Settings.cpp" + "${CMAKE_CURRENT_LIST_DIR}/SettingCommands.cpp" + "${CMAKE_CURRENT_LIST_DIR}/SettingsIO.cpp") + +target_sources(cathook PRIVATE ${files}) +list(REMOVE_ITEM ignore_files ${files}) +set(ignore_files ${ignore_files} CACHE INTERNAL "") diff --git a/src/textmode.cpp b/src/textmode.cpp index fa946f52..048a055f 100644 --- a/src/textmode.cpp +++ b/src/textmode.cpp @@ -34,7 +34,7 @@ void EXPOSED_Epic_VACBypass_1337_DoNotSteal_xXx_$1_xXx_MLG() CatCommand fixvac("fixvac", "Lemme in to secure servers", []() { EXPOSED_Epic_VACBypass_1337_DoNotSteal_xXx_$1_xXx_MLG(); }); -static InitRoutine init([]() { +static InitRoutine init_textmode([]() { #if ENABLE_TEXTMODE_STDIN logging::Info("[TEXTMODE] Setting up input handling"); int flags = fcntl(0, F_GETFL, 0); diff --git a/src/votelogger.cpp b/src/votelogger.cpp index 5950a3df..8ea461e8 100644 --- a/src/votelogger.cpp +++ b/src/votelogger.cpp @@ -194,17 +194,13 @@ public: bool vote_option = event->GetInt("vote_option"); if (*party_say_f1_only && vote_option) return; - int team = event->GetInt("team"); - int eid = event->GetInt("entityid"); + int eid = event->GetInt("entityid"); - player_info_s info{}, info2{}; + player_info_s info{}; if (!g_IEngine->GetPlayerInfo(eid, &info)) return; char formated_string[256]; - if (!g_IEngine->GetPlayerInfo(kicked_player, &info2)) - std::snprintf(formated_string, sizeof(formated_string), "[CAT] %s [U:1:%u] %s", info.name, info.friendsID, vote_option ? "F2" : "F1"); - else - std::snprintf(formated_string, sizeof(formated_string), "[CAT] %s [U:1:%u] %s => %s [U:1:%u] ", info.name, info.friendsID, vote_option ? "F1" : "F2", info2.name, info2.friendsID); + std::snprintf(formated_string, sizeof(formated_string), "[CAT] %s [U:1:%u] %s", info.name, info.friendsID, vote_option ? "F2" : "F1"); re::CTFPartyClient::GTFPartyClient()->SendPartyChat(formated_string); } }