Skip to content

Commit

Permalink
cvar value handling
Browse files Browse the repository at this point in the history
  • Loading branch information
wopox1337 committed Dec 26, 2019
1 parent a903680 commit 44f5abe
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions regamedll/dlls/gamerules.h
Original file line number Diff line number Diff line change
Expand Up @@ -903,7 +903,11 @@ inline float CGameRules::GetRadioTimeout()

inline float CGameRules::GetDyingTime()
{
#ifdef REGAMEDLL_ADD
return dying_time.value;
#else
return DYING_TIME;
#endif
}

bool IsBotSpeaking();
Expand Down
7 changes: 7 additions & 0 deletions regamedll/dlls/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2049,7 +2049,14 @@ void EXT_FUNC CBasePlayer::__API_HOOK(Killed)(entvars_t *pevAttacker, int iGib)
}

pev->modelindex = m_modelIndexPlayer;

#ifdef REGAMEDLL_ADD
constexpr float DYING_MIN_TIME = 2.0f;
pev->deadflag = (CGameRules::GetDyingTime() <= DYING_MIN_TIME) ? DEAD_DEAD : DEAD_DYING;
#else
pev->deadflag = DEAD_DYING;
#endif

pev->movetype = MOVETYPE_TOSS;
pev->takedamage = DAMAGE_NO;

Expand Down

0 comments on commit 44f5abe

Please sign in to comment.