diff options
| author | salmonik <salmonik@tuta.io> | 2026-11-04 18:08:07 +0100 |
|---|---|---|
| committer | salmonik <salmonik@tuta.io> | 2026-11-04 18:08:07 +0100 |
| commit | b3003583a1a66f5ae2eae63763f285635b43d58f (patch) | |
| tree | d4d2e778a2265652befcc86fbaa8bf1f4fcb30c3 /src/esp.cpp | |
| parent | Chams: quiet material lookup, accept any fallback by name (diff) | |
| download | hl2h-b3003583a1a66f5ae2eae63763f285635b43d58f.tar.gz hl2h-b3003583a1a66f5ae2eae63763f285635b43d58f.zip | |
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=.
Diffstat (limited to 'src/esp.cpp')
| -rw-r--r-- | src/esp.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
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) { | |||
| 173 | return is_npc_class(entity_class_name(net, nullptr)); | 173 | return is_npc_class(entity_class_name(net, nullptr)); |
| 174 | } | 174 | } |
| 175 | 175 | ||
| 176 | bool esp_is_viewmodel_index(int idx) { | ||
| 177 | if (!g_iface.entitylist || idx <= 0 || idx > 8192) | ||
| 178 | return false; | ||
| 179 | void *ent = entitylist_get(idx); | ||
| 180 | if (!ent) | ||
| 181 | return false; | ||
| 182 | void *net = entity_networkable(idx); | ||
| 183 | const char *cls = net ? entity_class_name(net, nullptr) : nullptr; | ||
| 184 | if (cls && strcasestr(cls, "viewmodel")) | ||
| 185 | return true; | ||
| 186 | const char *model = entity_model_name(ent); | ||
| 187 | return model && (strstr(model, "/v_") || strstr(model, "\\v_")); | ||
| 188 | } | ||
| 189 | |||
| 176 | static bool model_is_friendly(const char *m) { | 190 | static bool model_is_friendly(const char *m) { |
| 177 | static const char *patterns[] = { | 191 | static const char *patterns[] = { |
| 178 | "citizen", "humans/", "male_", "female_", "barney", "alyx", | 192 | "citizen", "humans/", "male_", "female_", "barney", "alyx", |
