diff --git a/src/core/interfaces.cpp b/src/core/interfaces.cpp index f4266f65..98ee9e8c 100644 --- a/src/core/interfaces.cpp +++ b/src/core/interfaces.cpp @@ -109,7 +109,7 @@ void CreateInterfaces() if (!su) { logging::Info("Connecting to Steam User"); - g_ISteamClient->ConnectToGlobalUser(sp); + su = g_ISteamClient->ConnectToGlobalUser(sp); } logging::Info("Inited Steam User"); g_IVModelRender = BruteforceInterface("VEngineModel", sharedobj::engine(), 16); diff --git a/src/hacks/Backtrack.cpp b/src/hacks/Backtrack.cpp index 01177ef3..0aa2a236 100644 --- a/src/hacks/Backtrack.cpp +++ b/src/hacks/Backtrack.cpp @@ -56,7 +56,7 @@ void AddLatencyToNetchan(INetChannel *ch) if (!isBacktrackEnabled) return; float Latency = *latency; - Latency -= ch->GetAvgLatency(FLOW_OUTGOING) * 1000.0f; + Latency -= (ch->GetAvgLatency(FLOW_OUTGOING) + ch->GetAvgLatency(FLOW_INCOMING)) * 1000.0f; if (Latency < 0.0f) Latency = 0.0f; for (auto &seq : sequences) @@ -326,7 +326,7 @@ float getLatency() auto ch = (INetChannel *) g_IEngine->GetNetChannelInfo(); if (!ch) return 0; - float Latency = *latency - ch->GetLatency(FLOW_OUTGOING) * 1000.0f; + float Latency = *latency - (ch->GetAvgLatency(FLOW_OUTGOING) + ch->GetAvgLatency(FLOW_INCOMING)) * 1000.0f; if (Latency < 0.0f) Latency = 0.0f; return Latency; @@ -430,4 +430,8 @@ static InitRoutine EC([]() { EC::Register(EC::Draw, Draw, "DRAW_Backtrack", EC::average); #endif }); +CatCommand debug_richpresence("debug_presence", "Debug stuff", []() { + g_ISteamFriends->SetRichPresence("steam_display", "#TF_RichPresence_State_PlayingGeneric"); + g_ISteamFriends->SetRichPresence("currentmap", "Cathooking"); +}); } // namespace hacks::shared::backtrack diff --git a/src/hacks/Noisemaker.cpp b/src/hacks/Noisemaker.cpp index cfb33d4c..4f2af60f 100644 --- a/src/hacks/Noisemaker.cpp +++ b/src/hacks/Noisemaker.cpp @@ -5,8 +5,8 @@ * Author: nullifiedcat */ -#include #include "common.hpp" +#include static settings::Bool enable{ "noisemaker-spam.enable", "false" }; @@ -26,5 +26,45 @@ static void CreateMove() } } } -static InitRoutine EC([]() { EC::Register(EC::CreateMove, CreateMove, "Noisemaker", EC::average); }); + +FnCommandCallbackVoid_t plus_use_action_slot_item_original; +FnCommandCallbackVoid_t minus_use_action_slot_item_original; + +void plus_use_action_slot_item_hook() +{ + KeyValues *kv = new KeyValues("+use_action_slot_item_server"); + g_IEngine->ServerCmdKeyValues(kv); +} + +void minus_use_action_slot_item_hook() +{ + KeyValues *kv = new KeyValues("-use_action_slot_item_server"); + g_IEngine->ServerCmdKeyValues(kv); +} + +static void init() +{ + auto plus = g_ICvar->FindCommand("+use_action_slot_item"); + auto minus = g_ICvar->FindCommand("-use_action_slot_item"); + if (!plus || !minus) + return ConColorMsg({ 255, 0, 0, 255 }, "Could not find +use_action_slot_item! INFINITE NOISE MAKER WILL NOT WORK!!!\n"); + plus_use_action_slot_item_original = plus->m_fnCommandCallbackV1; + minus_use_action_slot_item_original = minus->m_fnCommandCallbackV1; + plus->m_fnCommandCallbackV1 = plus_use_action_slot_item_hook; + minus->m_fnCommandCallbackV1 = minus_use_action_slot_item_hook; +} +static void shutdown() +{ + auto plus = g_ICvar->FindCommand("+use_action_slot_item"); + auto minus = g_ICvar->FindCommand("-use_action_slot_item"); + if (!plus || !minus) + return ConColorMsg({ 255, 0, 0, 255 }, "Could not find +use_action_slot_item! INFINITE NOISE MAKER WILL NOT WORK!!!\n"); + plus->m_fnCommandCallbackV1 = plus_use_action_slot_item_original; + minus->m_fnCommandCallbackV1 = minus_use_action_slot_item_original; +} +static InitRoutine EC([]() { + init(); + EC::Register(EC::CreateMove, CreateMove, "Noisemaker", EC::average); + EC::Register(EC::Shutdown, shutdown, "Noisemaker", EC::average); +}); } // namespace hacks::tf2::noisemaker diff --git a/src/hacks/SkinChanger.cpp b/src/hacks/SkinChanger.cpp index 52f0944d..2d4fff95 100644 --- a/src/hacks/SkinChanger.cpp +++ b/src/hacks/SkinChanger.cpp @@ -11,6 +11,7 @@ #include #include #include +#include static settings::Bool enable{ "skinchanger.enable", "false" }; static settings::Bool debug{ "skinchanger.debug", "false" }; @@ -95,6 +96,20 @@ void CAttributeList::SetAttribute(int index, float value) */ } +static std::array australium_table{ 4, 7, 13, 14, 15, 16, 18, 19, 20, 21, 29, 36, 38, 45, 61, 132, 141, 194, 197, 200, 201, 202, 203, 205, 206, 207, 208, 211, 228, 424, 654, 658, 659, 662, 663, 664, 665, 669, 1000, 1004, 1006, 1007, 1078, 1082, 1085, 1149 }; +static std::array, 12> redirects{ std::pair{ 264, 1071 }, std::pair{ 18, 205 }, std::pair{ 13, 200 }, std::pair{ 21, 208 }, std::pair{ 19, 206 }, std::pair{ 20, 207 }, std::pair{ 15, 202 }, std::pair{ 7, 197 }, std::pair{ 29, 211 }, std::pair{ 14, 201 }, std::pair{ 16, 203 }, std::pair{ 4, 194 } }; +static CatCommand australize("australize", "Make everything australium", []() { + enable = true; + for (auto i : redirects) + GetModifier(i.first).defidx_redirect = i.second; + for (auto i : australium_table) + { + GetModifier(i).Set(2027, 1); + GetModifier(i).Set(2022, 1); + GetModifier(i).Set(542, 1); + } + InvalidateCookie(); +}); static CatCommand set_attr("skinchanger_set", "Set Attribute", [](const CCommand &args) { unsigned attrid = strtoul(args.Arg(1), nullptr, 10); float attrv = strtof(args.Arg(2), nullptr); diff --git a/src/hooks/others.cpp b/src/hooks/others.cpp index 7dc12a55..cd485f23 100644 --- a/src/hooks/others.cpp +++ b/src/hooks/others.cpp @@ -59,15 +59,3 @@ CatCommand spectate("spectate", "Spectate", [](const CCommand &args) { }); #endif - -static CatCommand plus_use_action_slot_item_server("+cat_use_action_slot_item_server", "use_action_slot_item_server", []() { - KeyValues *kv = new KeyValues("+use_action_slot_item_server"); - g_pLocalPlayer->using_action_slot_item = true; - g_IEngine->ServerCmdKeyValues(kv); -}); - -static CatCommand minus_use_action_slot_item_server("-cat_use_action_slot_item_server", "use_action_slot_item_server", []() { - KeyValues *kv = new KeyValues("-use_action_slot_item_server"); - g_pLocalPlayer->using_action_slot_item = false; - g_IEngine->ServerCmdKeyValues(kv); -});