Skip to content

Commit

Permalink
KillOfRarity: Add feature in-air kill
Browse files Browse the repository at this point in the history
  • Loading branch information
s1lentq committed May 8, 2024
1 parent 8706cc5 commit 9f66264
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion regamedll/dlls/gamerules.h
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,8 @@ enum KillRarity
KILLRARITY_ASSISTEDFLASH = 0x020, // Assister helped with a flash
KILLRARITY_DOMINATION_BEGAN = 0x040, // Killer player began dominating the victim (NOTE: this flag is set once)
KILLRARITY_DOMINATION = 0x080, // Continues domination by the killer
KILLRARITY_REVENGE = 0x100 // Revenge by the killer
KILLRARITY_REVENGE = 0x100, // Revenge by the killer
KILLRARITY_INAIR = 0x200 // Killer was in the air (skill to deal with high inaccuracy)
};

enum
Expand Down
4 changes: 4 additions & 0 deletions regamedll/dlls/multiplay_gamerules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5314,6 +5314,10 @@ int CHalfLifeMultiplay::GetRarityOfKill(CBaseEntity *pKiller, CBasePlayer *pVict
const Vector inEyePos = pKillerPlayer->EyePosition();
if (TheCSBots()->IsLineBlockedBySmoke(&inEyePos, &pVictim->pev->origin))
iRarity |= KILLRARITY_THRUSMOKE;

// The killer player kills the victim while in air
if (!(pKillerPlayer->pev->flags & FL_ONGROUND))
iRarity |= KILLRARITY_INAIR;
}

// Calculate # of unanswered kills between killer & victim
Expand Down

0 comments on commit 9f66264

Please sign in to comment.