diff options
| author | salmonik <salmonik@tuta.io> | 2026-10-27 13:00:14 +0100 |
|---|---|---|
| committer | salmonik <salmonik@tuta.io> | 2026-10-27 13:00:14 +0100 |
| commit | b0696b2b5dae15c7a503aaabae27e915aff4673b (patch) | |
| tree | 14a84f235bdd55a3fffcfa1c6ac62f87ab55a340 /src/esp.cpp | |
| parent | ESP: HUD speed graph (last 10 s) (diff) | |
| download | hl2h-b0696b2b5dae15c7a503aaabae27e915aff4673b.tar.gz hl2h-b0696b2b5dae15c7a503aaabae27e915aff4673b.zip | |
Speed graph: only sample while in-game and unpaused
Diffstat (limited to '')
| -rw-r--r-- | src/esp.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/esp.cpp b/src/esp.cpp index 78a357c..e1e8fac 100644 --- a/src/esp.cpp +++ b/src/esp.cpp | |||
| @@ -341,6 +341,15 @@ static void draw_fov_circle() { | |||
| 341 | // Speed graph: 100 samples at 0.1 s = the last 10 seconds; min is 0, max is | 341 | // Speed graph: 100 samples at 0.1 s = the last 10 seconds; min is 0, max is |
| 342 | // the window maximum. Small and centered in the lower half of the screen. | 342 | // the window maximum. Small and centered in the lower half of the screen. |
| 343 | static void speed_graph_sample() { | 343 | static void speed_graph_sample() { |
| 344 | // Only while actually playing: IVEngineClient013 slot 26 IsInGame, | ||
| 345 | // slot 84 IsPaused. | ||
| 346 | if (g_iface.engine) { | ||
| 347 | using BoolFn = bool (*)(void *); | ||
| 348 | if (!vfunc<BoolFn>(g_iface.engine, 26)(g_iface.engine)) | ||
| 349 | return; | ||
| 350 | if (vfunc<BoolFn>(g_iface.engine, 84)(g_iface.engine)) | ||
| 351 | return; | ||
| 352 | } | ||
| 344 | double now = esp_now(); | 353 | double now = esp_now(); |
| 345 | if (now - g_speed_last_sample < 0.1) | 354 | if (now - g_speed_last_sample < 0.1) |
| 346 | return; | 355 | return; |
