From 074e315c8550712dce0c7b530a90eee6aca29e63 Mon Sep 17 00:00:00 2001 From: salmonik Date: Wed, 4 Nov 2026 23:26:53 +0100 Subject: 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. --- src/vischeck.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/vischeck.cpp') 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) { return tr.ent; } +// First solid/world hit along a segment, for grenade bounce prediction. +// Returns false on a clear path; otherwise fills the impact point and normal. +bool trace_solid_segment(const Vector &start, const Vector &end, void *ignore, + Vector &out_end, Vector &out_normal) { + if (!g_iface.enginetrace) + return false; + RayCompat ray; + make_ray(ray, start, end); + GameTraceCompat tr{}; + EntityFilter filter(ignore); + using TraceRayFn = void (*)(void *, const RayCompat *, unsigned, void *, + GameTraceCompat *); + vfunc(g_iface.enginetrace, 4)(g_iface.enginetrace, &ray, + MASK_PLAYERSOLID, &filter, &tr); + if (tr.startsolid || tr.fraction >= 1.0f) + return false; + out_end = tr.endpos; + out_normal = tr.normal; + return true; +} + // True when a downward point trace from just above `point` finds a standable // surface. Used by edge jump: a ledge has no floor within the probe, slopes and // stairs do. -- cgit v1.2.3