From 8b52a0a2ec5116fd44ffa00f95bf99113a93d399 Mon Sep 17 00:00:00 2001 From: salmonik Date: Tue, 27 Oct 2026 21:27:04 +0100 Subject: Item ESP: tag breakable wood/plastic/metal crates --- CONTEXT.md | 4 +++- src/esp.cpp | 13 +++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/CONTEXT.md b/CONTEXT.md index c5d8326..c8bc54e 100644 --- a/CONTEXT.md +++ b/CONTEXT.md @@ -278,7 +278,9 @@ vocabulary / decisions. independently of the hostile NPC ESP. - Detection is model-first (`models/items/...`, `models/healthvial.mdl`, `models/props_combine/*_charger*.mdl`, `models/w_longjump.mdl`) with class - fallbacks. Weapon pickups are intentionally not tagged. + fallbacks. Generic breakable wood/plastic/metal crates are tagged as + "Crate"; crate chunk debris is ignored. Weapon pickups are intentionally + not tagged. ## Roadmap / TODO diff --git a/src/esp.cpp b/src/esp.cpp index d10a2cf..0d64c78 100644 --- a/src/esp.cpp +++ b/src/esp.cpp @@ -1371,6 +1371,10 @@ static int classify_item(const char *model, const char *cls, char *label, if (!model && !cls) return -1; + // Breakable prop chunks are debris, not pickups. + if (item_icontains(model, "chunk")) + return -1; + if (item_icontains(model, "healthkit")) { snprintf(label, outn, "Medkit"); return IK_HEALTH; @@ -1408,6 +1412,11 @@ static int classify_item(const char *model, const char *cls, char *label, snprintf(label, outn, "Ammo crate"); return IK_AMMO; } + // Generic breakable crates (wood/plastic/metal) are supply caches too. + if (item_icontains(model, "crate")) { + snprintf(label, outn, "Crate"); + return IK_CRATE; + } if (item_icontains(model, "w_missile_closed")) { snprintf(label, outn, "RPG ammo"); return IK_AMMO; @@ -1447,6 +1456,10 @@ static int classify_item(const char *model, const char *cls, char *label, snprintf(label, outn, "Ammo"); return IK_AMMO; } + if (item_icontains(cls, "crate")) { + snprintf(label, outn, "Crate"); + return IK_CRATE; + } if (item_icontains(cls, "item") || item_icontains(cls, "pickup")) { snprintf(label, outn, "Item"); return IK_OTHER; -- cgit v1.2.3