From 4e99047155db675e93d64e418391eea37372c851 Mon Sep 17 00:00:00 2001 From: Denzer <43782090+ddenzer@users.noreply.github.com> Date: Tue, 3 Nov 2020 18:37:49 +0700 Subject: [PATCH] updated PlayerExtraInfo pattern (#2) * updated PlayerExtraInfo pattern * updated struct extra_player_info_t * fixed bug with cl_minmodels * fixed PlayerExtraInfo pattern --- hitboxtracker/client/src/hud.h | 3 +++ hitboxtracker/client/src/modules/client.cpp | 2 +- hitboxtracker/client/src/studio/GameStudioModelRenderer.cpp | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/hitboxtracker/client/src/hud.h b/hitboxtracker/client/src/hud.h index 71f2abd..6f095ed 100644 --- a/hitboxtracker/client/src/hud.h +++ b/hitboxtracker/client/src/hud.h @@ -73,6 +73,9 @@ struct extra_player_info_t float showhealth; int health; char location[32]; + int sb_health; + int sb_account; + int has_defuse_kit; }; // Macros to hook function calls into the HUD object diff --git a/hitboxtracker/client/src/modules/client.cpp b/hitboxtracker/client/src/modules/client.cpp index 01dc969..64f851c 100644 --- a/hitboxtracker/client/src/modules/client.cpp +++ b/hitboxtracker/client/src/modules/client.cpp @@ -57,7 +57,7 @@ extra_player_info_t **CClient::FindPlayerExtraInfo() return nullptr; } - pos = find_pattern(pos, 32, "\x0F\xBF\x04\x2A\x2A\x2A\x2A\x2A\xC3"); + pos = find_pattern(pos, 64, "\x0F\xBF\x04\x2A\x2A\x2A\x2A\x2A\xC3"); if (!pos) { return nullptr; } diff --git a/hitboxtracker/client/src/studio/GameStudioModelRenderer.cpp b/hitboxtracker/client/src/studio/GameStudioModelRenderer.cpp index 63cadcc..2c60976 100644 --- a/hitboxtracker/client/src/studio/GameStudioModelRenderer.cpp +++ b/hitboxtracker/client/src/studio/GameStudioModelRenderer.cpp @@ -874,9 +874,9 @@ int CGameStudioModelRenderer::_StudioDrawPlayer(int flags, entity_state_t *pplay if (cl_minmodels && cl_minmodels->value) { - if (g_PlayerExtraInfo[pplayer->number].teamnumber == TEAM_CT) + if (g_PlayerExtraInfo[pplayer->number].teamnumber == TEAM_TERRORIST) { - int modelindex = (cl_min_t && IsValidCTModelIndex(cl_min_t->value)) ? cl_min_t->value : CS_LEET; + int modelindex = (cl_min_t && IsValidTModelIndex(cl_min_t->value)) ? cl_min_t->value : CS_LEET; m_pRenderModel = gEngfuncs.CL_LoadModel(sPlayerModelFiles[modelindex], nullptr); } else if (g_PlayerExtraInfo[pplayer->number].teamnumber == TEAM_CT)