diff options
| author | salmonik <salmonik@tuta.io> | 2026-10-28 13:02:26 +0100 |
|---|---|---|
| committer | salmonik <salmonik@tuta.io> | 2026-10-28 13:02:26 +0100 |
| commit | b212e8e13835cfdc4849a61c1b57146bd0312a29 (patch) | |
| tree | 128a64c8c20411749ee8ea4a78ef4a51a9604515 /src/hl2h.cpp | |
| parent | Combat: fix silent-aim spread seed and lead projectiles (diff) | |
| download | hl2h-b212e8e13835cfdc4849a61c1b57146bd0312a29.tar.gz hl2h-b212e8e13835cfdc4849a61c1b57146bd0312a29.zip | |
Melee: surface weapon state across maps; reset stale caches
- Map transitions often leave a non-crowbar weapon active, so the killbot
silently does nothing. Log every active-weapon change as a normal
`melee: active ... crowbar=0/1` line and toast once suggesting the crowbar.
- Recover the crowbar model from the server entity when the client weapon
model index is missing/0 after a map change.
- Clear the bone cache and aim/silent locks when the local player entity
changes (map load/respawn) so stale entity/model data cannot poison melee
target selection.
Diffstat (limited to '')
| -rw-r--r-- | src/hl2h.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/hl2h.cpp b/src/hl2h.cpp index 4f5673f..f95f6ed 100644 --- a/src/hl2h.cpp +++ b/src/hl2h.cpp | |||
| @@ -556,6 +556,15 @@ static void do_move(int seq, float frametime) { | |||
| 556 | if (!ent) | 556 | if (!ent) |
| 557 | return; | 557 | return; |
| 558 | 558 | ||
| 559 | // New map / respawn: drop stale bone caches and target locks. | ||
| 560 | static void *last_local_ent = nullptr; | ||
| 561 | if (ent != last_local_ent) { | ||
| 562 | last_local_ent = ent; | ||
| 563 | bones_clear(); | ||
| 564 | aimbot_reset_lock(); | ||
| 565 | silentaim_reset_lock(); | ||
| 566 | } | ||
| 567 | |||
| 559 | if (feature_active(FEAT_SPREAD)) { | 568 | if (feature_active(FEAT_SPREAD)) { |
| 560 | resolve_server_netvars(); | 569 | resolve_server_netvars(); |
| 561 | void *srv = nullptr; | 570 | void *srv = nullptr; |
