diff options
| author | salmonik <salmonik@tuta.io> | 2026-11-04 23:26:53 +0100 |
|---|---|---|
| committer | salmonik <salmonik@tuta.io> | 2026-11-04 23:26:53 +0100 |
| commit | 074e315c8550712dce0c7b530a90eee6aca29e63 (patch) | |
| tree | fc5d6ecf6dce582971f0c3878b68f4714b8e6fba /src/vischeck.cpp | |
| parent | Chams: working alpha via RenderView blend and a custom VMT (diff) | |
| download | hl2h-074e315c8550712dce0c7b530a90eee6aca29e63.tar.gz hl2h-074e315c8550712dce0c7b530a90eee6aca29e63.zip | |
Add grenade trajectory, RPG armour priority, empty chargers, mega gravity gun
- Projectiles gets a "Grenade trajectory" toggle. While a frag grenade is
held, simulate the weapon_frag throw (1200 u/s forward + 120 z, player
velocity, gravity 600) and trace each step with a new
trace_solid_segment(); reflect on impact, stop on a slow upward-normal hit,
and draw the path, landing cross and a 300-unit blast ring. Verified on :99
(arcs, bounces off the tunnel wall, lands).
- With the RPG equipped, armoured NPCs (striders, gunships, dropships,
hunter-choppers) sort before normal enemies during target acquisition.
Added helicopter/chopper to the ARMORED model list.
- Empty health/suit chargers are hidden: read m_iJuice from the server
datamap (0 = depleted, -1 = unreadable/fail open).
- The citadel supercharged gravity gun (d3_citadel_03, d3_citadel_04,
d3_breen_01 via IVEngineClient::GetLevelName) is treated as a normal
weapon, so the melee aimbot no longer restricts it to VULNERABLE NPCs.
Diffstat (limited to '')
| -rw-r--r-- | src/vischeck.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/vischeck.cpp b/src/vischeck.cpp index c8c0942..6b531b9 100644 --- a/src/vischeck.cpp +++ b/src/vischeck.cpp | |||
| @@ -232,6 +232,27 @@ void *trace_entity(const Vector &start, const Vector &end, void *ignore) { | |||
| 232 | return tr.ent; | 232 | return tr.ent; |
| 233 | } | 233 | } |
| 234 | 234 | ||
| 235 | // First solid/world hit along a segment, for grenade bounce prediction. | ||
| 236 | // Returns false on a clear path; otherwise fills the impact point and normal. | ||
| 237 | bool trace_solid_segment(const Vector &start, const Vector &end, void *ignore, | ||
| 238 | Vector &out_end, Vector &out_normal) { | ||
| 239 | if (!g_iface.enginetrace) | ||
| 240 | return false; | ||
| 241 | RayCompat ray; | ||
| 242 | make_ray(ray, start, end); | ||
| 243 | GameTraceCompat tr{}; | ||
| 244 | EntityFilter filter(ignore); | ||
| 245 | using TraceRayFn = void (*)(void *, const RayCompat *, unsigned, void *, | ||
| 246 | GameTraceCompat *); | ||
| 247 | vfunc<TraceRayFn>(g_iface.enginetrace, 4)(g_iface.enginetrace, &ray, | ||
| 248 | MASK_PLAYERSOLID, &filter, &tr); | ||
| 249 | if (tr.startsolid || tr.fraction >= 1.0f) | ||
| 250 | return false; | ||
| 251 | out_end = tr.endpos; | ||
| 252 | out_normal = tr.normal; | ||
| 253 | return true; | ||
| 254 | } | ||
| 255 | |||
| 235 | // True when a downward point trace from just above `point` finds a standable | 256 | // True when a downward point trace from just above `point` finds a standable |
| 236 | // surface. Used by edge jump: a ledge has no floor within the probe, slopes and | 257 | // surface. Used by edge jump: a ledge has no floor within the probe, slopes and |
| 237 | // stairs do. | 258 | // stairs do. |
