Skip to content

Commit

Permalink
Do not reduce points for suicide due to a fatal fall
Browse files Browse the repository at this point in the history
  • Loading branch information
s1lentq committed Jan 31, 2024
1 parent aec3ba2 commit 0bbc4bd
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions regamedll/dlls/multiplay_gamerules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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())
{
Expand Down Expand Up @@ -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)]);
Expand Down

0 comments on commit 0bbc4bd

Please sign in to comment.