Set KILLRARITY_KILLER_BLIND flag only when fully blind

This commit is contained in:
s1lentq 2023-12-23 02:51:04 +07:00
parent 0e68bedf24
commit 6c9019bcc8
2 changed files with 2 additions and 1 deletions

View File

@ -5264,7 +5264,7 @@ int CHalfLifeMultiplay::GetRarityOfKill(CBaseEntity *pKiller, CBasePlayer *pVict
if (pVictim->GetDmgPenetrationLevel() > 0)
iRarity |= KILLRARITY_PENETRATED;
if (pKillerPlayer->IsBlind())
if (pKillerPlayer->IsFullyBlind())
iRarity |= KILLRARITY_KILLER_BLIND;
// The killer player kills the victim with a sniper rifle with no scope

View File

@ -590,6 +590,7 @@ public:
bool IsReloading() const;
bool HasTimePassedSinceDeath(float duration) const;
bool IsBlind() const { return (m_blindUntilTime > gpGlobals->time); }
bool IsFullyBlind(const float flPeekTime = 0.6f) const { return m_blindAlpha >= 255 && m_blindFadeTime > (flPeekTime * 2.0f) && (m_blindStartTime + m_blindHoldTime + flPeekTime) > gpGlobals->time; }
bool IsAutoFollowAllowed() const { return (gpGlobals->time > m_allowAutoFollowTime); }
void InhibitAutoFollow(float duration) { m_allowAutoFollowTime = gpGlobals->time + duration; }
void AllowAutoFollow() { m_allowAutoFollowTime = 0; }