summaryrefslogtreecommitdiffstats
path: root/src/esp.cpp
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-10-27 20:15:51 +0100
committersalmonik <salmonik@tuta.io>2026-10-27 20:15:51 +0100
commitba500fef7fbf94725f18541b0e23a45591379dba (patch)
treef1eec8ad34e532fb7bcb9172083c78d96bcdca4f /src/esp.cpp
parentOverlay: keep GUI and toasts drawing if the ESP font fails (diff)
downloadhl2h-ba500fef7fbf94725f18541b0e23a45591379dba.tar.gz
hl2h-ba500fef7fbf94725f18541b0e23a45591379dba.zip
Fix tooltip truncation; add Stucklaunch assist
Tooltips: text_in() shifted the x position to fit the full string before truncating, which drew the tooltip text outside its box. Truncate to the available width first, then clamp inside the clip. Stucklaunch (Movement): - opt-in feature (Active off by default) with its own bind; - holds jump, alternates +use every 2 ticks to regrab a physics prop, optionally +attack while the gravity gun is active, and air-strafes; - engagement uses m_hGroundEntity (client netvar) latched for ~0.5 s so the prop stays active while airborne; falls back to running whenever active if the netvar is unavailable, with a startup warning to bind it; - does not spawn or place props; the player supplies the prop and initial speed. Config gets [stucklaunch] active/bind/use_spam/gravspam/autostrafe; Reset restores those defaults. CONTEXT documents the assist and its limits.
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;