summaryrefslogtreecommitdiffstats
path: root/src/esp.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/esp.cpp14
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
176bool 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
176static bool model_is_friendly(const char *m) { 190static 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",