From 9f662645623fcafb2fbb6d840e13360edac27b2f Mon Sep 17 00:00:00 2001 From: s1lentq Date: Thu, 9 May 2024 02:38:12 +0700 Subject: [PATCH] KillOfRarity: Add feature in-air kill --- regamedll/dlls/gamerules.h | 3 ++- regamedll/dlls/multiplay_gamerules.cpp | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/regamedll/dlls/gamerules.h b/regamedll/dlls/gamerules.h index 8d15e9ee4..cc6e9ec8f 100644 --- a/regamedll/dlls/gamerules.h +++ b/regamedll/dlls/gamerules.h @@ -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 diff --git a/regamedll/dlls/multiplay_gamerules.cpp b/regamedll/dlls/multiplay_gamerules.cpp index ba71bcebb..f9aaa8c30 100644 --- a/regamedll/dlls/multiplay_gamerules.cpp +++ b/regamedll/dlls/multiplay_gamerules.cpp @@ -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