From b3003583a1a66f5ae2eae63763f285635b43d58f Mon Sep 17 00:00:00 2001 From: salmonik Date: Wed, 4 Nov 2026 18:08:07 +0100 Subject: Chams: material styles and viewmodel support - Material selector 0..4: debugwhite, debug wireframe (ignorez), vgui white_additive, debugtranslucentsinglecolor, vgui/white; cached per index with a debugwhite fallback. - Add "Viewmodel (hands/weapon)" toggle; viewmodel entities (class contains viewmodel or model path /v_...) get a normal-depth chams pass. - [chams] gains viewmodel= and material=. --- src/esp.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/esp.cpp') diff --git a/src/esp.cpp b/src/esp.cpp index b50dd87..1631df1 100644 --- a/src/esp.cpp +++ b/src/esp.cpp @@ -173,6 +173,20 @@ bool esp_is_npc_index(int idx) { return is_npc_class(entity_class_name(net, nullptr)); } +bool esp_is_viewmodel_index(int idx) { + if (!g_iface.entitylist || idx <= 0 || idx > 8192) + return false; + void *ent = entitylist_get(idx); + if (!ent) + return false; + void *net = entity_networkable(idx); + const char *cls = net ? entity_class_name(net, nullptr) : nullptr; + if (cls && strcasestr(cls, "viewmodel")) + return true; + const char *model = entity_model_name(ent); + return model && (strstr(model, "/v_") || strstr(model, "\\v_")); +} + static bool model_is_friendly(const char *m) { static const char *patterns[] = { "citizen", "humans/", "male_", "female_", "barney", "alyx", -- cgit v1.2.3