From 27d1f617890f1a158b7b186754a2f8ffe8da337b Mon Sep 17 00:00:00 2001 From: Caball Date: Mon, 30 Dec 2024 23:13:16 +0100 Subject: [PATCH] Added hook and fn stub to clean color from agent overhead name. --- src/client/component/colors.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/client/component/colors.cpp b/src/client/component/colors.cpp index 7912ce5..d84818f 100644 --- a/src/client/component/colors.cpp +++ b/src/client/component/colors.cpp @@ -98,6 +98,16 @@ namespace colors return result; } + int clean_agent_name_stub(char* out, int max_size, const char* fmt, const char* in) + { + // format agent overhead name like [%s] + const auto length = sprintf_s(out, max_size, fmt, in); + + utils::string::strip(in, out, std::min(static_cast(length), static_cast(max_size))); + + return length; + } + void rb_lookup_color_stub(const char index, DWORD* color) { *color = RGB(255, 255, 255); @@ -143,6 +153,9 @@ namespace colors // don't apply colors to overhead names utils::hook::call(0x14025CE79, get_client_name_stub); + // don't apply colors to overhead names of agents (like dogs or juggernauts) + utils::hook::call(0x1402CF760, clean_agent_name_stub); + // patch I_CleanStr utils::hook::jump(0x1404F63C0, i_clean_str_stub); }