From ac5052e5dcb01fd76b04415da4ce80dfe6ee3896 Mon Sep 17 00:00:00 2001 From: nullsystem <15316579+nullsystem@users.noreply.github.com> Date: Tue, 25 Aug 2026 20:04:08 +0100 Subject: [PATCH] Fix not showing grenade/det icon on death HUD Just relying on the previous bools given. Overlay stay on using by index. --- .../client/neo/ui/neo_hud_spectator_overlay.cpp | 2 +- src/game/shared/neo/neo_gamerules.cpp | 4 +++- .../neo/weapons/weapon_neobasecombatweapon.cpp | 13 ++++++++++--- .../shared/neo/weapons/weapon_neobasecombatweapon.h | 9 ++++++++- 4 files changed, 22 insertions(+), 6 deletions(-) diff --git a/src/game/client/neo/ui/neo_hud_spectator_overlay.cpp b/src/game/client/neo/ui/neo_hud_spectator_overlay.cpp index f614bdc82..702a60a92 100644 --- a/src/game/client/neo/ui/neo_hud_spectator_overlay.cpp +++ b/src/game/client/neo/ui/neo_hud_spectator_overlay.cpp @@ -384,7 +384,7 @@ void CNEOHud_SpectatorOverlay::UpdateStateForNeoHudElementDraw() } // Icons are really only 1 character long - Q_UTF8ToUnicode(pNeoWep->GetDeathIcon(), + Q_UTF8ToUnicode(pNeoWep->GetDeathIcon(DEATHICONTYPE_IDX), wszWeaponIcon, sizeof(wszWeaponIcon)); pCard->wcaWeaponIcons[pCard->iTotalWeaponIcons++] = wszWeaponIcon[0]; } diff --git a/src/game/shared/neo/neo_gamerules.cpp b/src/game/shared/neo/neo_gamerules.cpp index 8acd11261..bc04f054f 100644 --- a/src/game/shared/neo/neo_gamerules.cpp +++ b/src/game/shared/neo/neo_gamerules.cpp @@ -4351,7 +4351,9 @@ void CNEORules::DeathNotice(CBasePlayer* pVictim, const CTakeDamageInfo& info) event->SetInt("priority", 7); event->SetBool("headshot", pVictim->LastHitGroup() == HITGROUP_HEAD); event->SetBool("suicide", pKiller == pVictim || !pKiller->IsPlayer()); - event->SetString("deathIcon", neoWep ? neoWep->GetDeathIcon() : ""); + event->SetString("deathIcon", neoWep + ? neoWep->GetDeathIcon(DEATHICONTYPE_BOOLS, isGrenade, isRemoteDetpack) + : ""); event->SetBool("explosive", isGrenade || isRemoteDetpack); event->SetBool("ghoster", m_iGhosterPlayer == pVictim->entindex()); diff --git a/src/game/shared/neo/weapons/weapon_neobasecombatweapon.cpp b/src/game/shared/neo/weapons/weapon_neobasecombatweapon.cpp index c1c39cfdb..322d02420 100644 --- a/src/game/shared/neo/weapons/weapon_neobasecombatweapon.cpp +++ b/src/game/shared/neo/weapons/weapon_neobasecombatweapon.cpp @@ -1407,13 +1407,20 @@ void CNEOBaseCombatWeapon::Use(CBaseEntity* pActivator, CBaseEntity* pCaller, US } #endif -const char *CNEOBaseCombatWeapon::GetDeathIcon() const +const char *CNEOBaseCombatWeapon::GetDeathIcon(const EDeathIconType eType, + bool isGrenade, bool isRemoteDetpack) const { - if (WeaponIndex() == NEO_WIDX_FRAG_GRENADE) + if (eType == DEATHICONTYPE_IDX) + { + isGrenade = WeaponIndex() == NEO_WIDX_FRAG_GRENADE; + isRemoteDetpack = WeaponIndex() == NEO_WIDX_DETPACK; + } + + if (isGrenade) { return "2"; } - else if (WeaponIndex() == NEO_WIDX_DETPACK) + else if (isRemoteDetpack) { return "A"; } diff --git a/src/game/shared/neo/weapons/weapon_neobasecombatweapon.h b/src/game/shared/neo/weapons/weapon_neobasecombatweapon.h index f209a94e2..8230536ae 100644 --- a/src/game/shared/neo/weapons/weapon_neobasecombatweapon.h +++ b/src/game/shared/neo/weapons/weapon_neobasecombatweapon.h @@ -114,6 +114,12 @@ SendPropInt(SENDINFO(m_nNumShotsFired)), #endif #endif +enum EDeathIconType +{ + DEATHICONTYPE_IDX = 0, + DEATHICONTYPE_BOOLS, +}; + class CNEOBaseCombatWeapon : public CBaseHL2MPCombatWeapon { DECLARE_CLASS(CNEOBaseCombatWeapon, CBaseHL2MPCombatWeapon); @@ -260,7 +266,8 @@ class CNEOBaseCombatWeapon : public CBaseHL2MPCombatWeapon int m_spawnflags; #endif // CLIENT_DLL - const char *GetDeathIcon() const; + const char *GetDeathIcon(const EDeathIconType eType, + bool isGrenade = false, bool isRemoteDetpack = false) const; protected: WeaponHandlingInfo_t m_weaponHandling;