Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/game/client/neo/ui/neo_hud_spectator_overlay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
Expand Down
4 changes: 3 additions & 1 deletion src/game/shared/neo/neo_gamerules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());

Expand Down
13 changes: 10 additions & 3 deletions src/game/shared/neo/weapons/weapon_neobasecombatweapon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
Expand Down
9 changes: 8 additions & 1 deletion src/game/shared/neo/weapons/weapon_neobasecombatweapon.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down