From 0bbc4bd55d437a7097ba969b0922b1bd14a4380c Mon Sep 17 00:00:00 2001 From: s1lentq Date: Wed, 31 Jan 2024 18:38:47 +0700 Subject: [PATCH] Do not reduce points for suicide due to a fatal fall --- regamedll/dlls/multiplay_gamerules.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/regamedll/dlls/multiplay_gamerules.cpp b/regamedll/dlls/multiplay_gamerules.cpp index 229da7c1..e0d27dfb 100644 --- a/regamedll/dlls/multiplay_gamerules.cpp +++ b/regamedll/dlls/multiplay_gamerules.cpp @@ -3960,11 +3960,20 @@ void EXT_FUNC CHalfLifeMultiplay::__API_HOOK(PlayerKilled)(CBasePlayer *pVictim, } FireTargets("game_playerdie", pVictim, pVictim, USE_TOGGLE, 0); + +#ifdef REGAMEDLL_FIXES + // Did the player die from a fall? + if (pVictim->m_bitsDamageType & DMG_FALL) + { + // do nothing + } + else +#endif // Did the player kill himself? if (pVictim->pev == pKiller) { // Players lose a frag for killing themselves - pKiller->frags -= 1; + pVictim->pev->frags -= 1; } else if (peKiller && peKiller->IsPlayer()) { @@ -5404,7 +5413,7 @@ void CHalfLifeMultiplay::GiveDefuserToRandomPlayer() candidates.AddToTail(pPlayer); } - + // randomly shuffle the list; this will keep the selection random in case of ties for (int i = 0; i < candidates.Count(); i++) { SWAP(candidates[i], candidates[RANDOM_LONG(0, candidates.Count() - 1)]);