summaryrefslogtreecommitdiffstats
path: root/src/esp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/esp.cpp')
-rw-r--r--src/esp.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/esp.cpp b/src/esp.cpp
index 64ee83f..bda6232 100644
--- a/src/esp.cpp
+++ b/src/esp.cpp
@@ -1131,6 +1131,40 @@ static void spread_compute() {
1131 g_spread_ready = true; 1131 g_spread_ready = true;
1132} 1132}
1133 1133
1134bool entity_is_physics_prop(int idx) {
1135 if (idx <= 0 || idx > 4096)
1136 return false;
1137 void *net = entity_networkable(idx);
1138 const char *cls = net ? entity_class_name(net, nullptr) : nullptr;
1139 void *ent = entitylist_get(idx);
1140 const char *model = ent ? entity_model_name(ent) : nullptr;
1141 if (cls && (strstr(cls, "prop_physics") || strstr(cls, "physbox")))
1142 return true;
1143 if (model && (strstr(model, "props_junk") || strstr(model, "props_physics")))
1144 return true;
1145 return false;
1146}
1147
1148bool active_weapon_is_gravity_gun(void *local_ent) {
1149 if (!local_ent || g_net.activeweapon < 0)
1150 return false;
1151 uint32_t h = *(uint32_t *)((uintptr_t)local_ent + g_net.activeweapon);
1152 if (h == 0xFFFFFFFFu)
1153 return false;
1154 int idx = (int)(h & 0xFFFF);
1155 if (idx <= 0 || idx > 4096)
1156 return false;
1157 void *wep = entitylist_get(idx);
1158 void *net = entity_networkable(idx);
1159 const char *cls = net ? entity_class_name(net, nullptr) : nullptr;
1160 const char *model = wep ? entity_model_name(wep) : nullptr;
1161 if (cls && strstr(cls, "physcannon"))
1162 return true;
1163 if (model && (strstr(model, "physcannon") || strstr(model, "w_physics")))
1164 return true;
1165 return false;
1166}
1167
1134static bool active_weapon_is_shotgun(void *local_ent) { 1168static bool active_weapon_is_shotgun(void *local_ent) {
1135 if (!local_ent || g_net.activeweapon < 0) 1169 if (!local_ent || g_net.activeweapon < 0)
1136 return false; 1170 return false;