diff options
| author | salmonik <salmonik@tuta.io> | 2026-11-05 20:33:33 +0100 |
|---|---|---|
| committer | salmonik <salmonik@tuta.io> | 2026-11-05 20:33:33 +0100 |
| commit | 94745d7d11ecf24a582dd8860e14eb42c170185d (patch) | |
| tree | 8b3ca96abd6c42a704d5d6fef54eeab762665b0d | |
| parent | Items: server ammo counts and frag-grenade type (diff) | |
| download | hl2h-94745d7d11ecf24a582dd8860e14eb42c170185d.tar.gz hl2h-94745d7d11ecf24a582dd8860e14eb42c170185d.zip | |
Items: log the usable ammo table once
One line with each nonzero m_iAmmo type as "type:count/max" (0:270/270
8:3/3 11:5/5 ...) to diagnose any remaining "full ammo still shows" reports.
| -rw-r--r-- | src/esp.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/esp.cpp b/src/esp.cpp index 7ddc86b..72110cc 100644 --- a/src/esp.cpp +++ b/src/esp.cpp | |||
| @@ -2933,6 +2933,20 @@ void esp_draw_items() { | |||
| 2933 | int vit_hp = -1, vit_max = -1, vit_armor = -1; | 2933 | int vit_hp = -1, vit_max = -1, vit_armor = -1; |
| 2934 | if (g_item_usable) | 2934 | if (g_item_usable) |
| 2935 | local_vitals(vit_hp, vit_max, vit_armor); | 2935 | local_vitals(vit_hp, vit_max, vit_armor); |
| 2936 | static bool ammo_logged = false; | ||
| 2937 | if (g_item_usable && !ammo_logged) { | ||
| 2938 | ammo_logged = true; | ||
| 2939 | char buf[512]; | ||
| 2940 | int pos = 0; | ||
| 2941 | void *le = entitylist_get(local); | ||
| 2942 | for (int t = 0; t < 16 && pos < 500; t++) { | ||
| 2943 | int a = local_ammo(le, t); | ||
| 2944 | int m = ammo_max(t); | ||
| 2945 | if (a >= 0 && m > 0) | ||
| 2946 | pos += snprintf(buf + pos, sizeof(buf) - pos, " %d:%d/%d", t, a, m); | ||
| 2947 | } | ||
| 2948 | logf("items: ammo%s", buf); | ||
| 2949 | } | ||
| 2936 | 2950 | ||
| 2937 | for (int i = 0; i < g_nitems; i++) { | 2951 | for (int i = 0; i < g_nitems; i++) { |
| 2938 | const ItemTarget &t = g_item_targets[i]; | 2952 | const ItemTarget &t = g_item_targets[i]; |
