diff options
Diffstat (limited to '')
| -rw-r--r-- | src/esp.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/esp.cpp b/src/esp.cpp index 594a8fa..dbe0051 100644 --- a/src/esp.cpp +++ b/src/esp.cpp | |||
| @@ -2655,6 +2655,16 @@ static bool item_kind_enabled(int kind) { | |||
| 2655 | } | 2655 | } |
| 2656 | } | 2656 | } |
| 2657 | 2657 | ||
| 2658 | // Health chargers are brushes (func_healthcharger/CWallHealth) and suit | ||
| 2659 | // chargers are item_suitcharger/CNewRecharge. Both expose m_iJuice. | ||
| 2660 | static bool item_is_charger(const char *model, const char *cls) { | ||
| 2661 | return item_icontains(model, "charger") || | ||
| 2662 | item_icontains(model, "suit_charger") || | ||
| 2663 | item_icontains(cls, "charger") || | ||
| 2664 | item_icontains(cls, "wallhealth") || | ||
| 2665 | item_icontains(cls, "recharge"); | ||
| 2666 | } | ||
| 2667 | |||
| 2658 | static void items_collect(int local_idx) { | 2668 | static void items_collect(int local_idx) { |
| 2659 | static double last_scan = 0.0; | 2669 | static double last_scan = 0.0; |
| 2660 | double now = esp_now(); | 2670 | double now = esp_now(); |
| @@ -2784,7 +2794,7 @@ static void items_collect(int local_idx) { | |||
| 2784 | // Health/suit chargers are dispensers that stay useful after a refill, but | 2794 | // Health/suit chargers are dispensers that stay useful after a refill, but |
| 2785 | // an empty one cannot give anything. m_iJuice is 0 when depleted (until it | 2795 | // an empty one cannot give anything. m_iJuice is 0 when depleted (until it |
| 2786 | // recharges); only hide the tag once the server value is readable. | 2796 | // recharges); only hide the tag once the server value is readable. |
| 2787 | if (strcasestr(label, "charger") && server_item_juice(idx) == 0) | 2797 | if (item_is_charger(model, cls) && server_item_juice(idx) == 0) |
| 2788 | continue; | 2798 | continue; |
| 2789 | 2799 | ||
| 2790 | Vector origin{*(float *)((uintptr_t)ent + g_net.origin), | 2800 | Vector origin{*(float *)((uintptr_t)ent + g_net.origin), |
