diff --git a/README.md b/README.md index 66e3b27a..2e11b3c1 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,8 @@ Archive's bin directory contains 2 subdirectories, 'bugfixed' and 'pure' | mp_hullbounds_sets | 1 | 0 | 1 | Sets mins/maxs hull bounds for the player.
`0` disabled
`1` enabled | | mp_unduck_method | 0 | 0 | 1 | Don't unduck if ducking isn't finished yet.
`0` disabled
`1` enabled
`NOTE`: This also prevents double duck. | | mp_scoreboard_showhealth | 3 | 0 | 5 | Show `HP` field into a scoreboard.
`0` don't send any update for `HP` field to any clients
`1` show only Terrorist `HP` field to all clients
`2` show only CT `HP` field to all clients
`3` show `HP` field to teammates
`4` show `HP` field to all clients
`5` show `HP` field to teammates and spectators | -| mp_scoreboard_showmoney | 3 | 0 | 5 | Show `Money` field into a scoreboard.
`0` don't send any update for `Money` field to any clients
`1` show only Terrorist `Money` field to all clients
`2` show only CT `Money` field to all clients
`3` show `Money` field to teammates
`4` show `Money` field to all clients
`5` show `Money` field to teammates and spectators | +| mp_scoreboard_showmoney | 3 | 0 | 5 | Show `Money` field into a scoreboard.
`0` don't send any update for `Money` field to any clients
`1` show only Terrorist `Money` field to all clients
`2` show only CT `Money` field to all clients
`3` show `Money` field to teammates
`4` show `Money` field to all clients
`5` show `Money` field to teammates and spectators | +| mp_scoreboard_showdefkit | 1 | 0 | 1 | Show `D. Kit` field into a scoreboard for teammates.
`0` disabled
`1` enabled
`NOTE`: If you don't want to show `D. Kit` field for dead enemies then disable this CVar or configure mp_forcecamera | | ff_damage_reduction_bullets | 0.35 | 0.0 | 1.0 | How much to reduce damage done to teammates when shot.
Range is from `0` - `1` (with 1 being damage equal to what is done to an enemy) | | ff_damage_reduction_grenade | 0.25 | 0.0 | 1.0 | How much to reduce damage done to teammates by a thrown grenade.
Range is from `0` - `1` (with 1 being damage equal to what is done to an enemy) | | ff_damage_reduction_grenade_self | 1.0 | 0.0 | 1.0 | How much to damage a player does to himself with his own grenade.
Range is from `0` - `1` (with 1 being damage equal to what is done to an enemy) | diff --git a/dist/game.cfg b/dist/game.cfg index 5befb181..5c2e932f 100644 --- a/dist/game.cfg +++ b/dist/game.cfg @@ -281,6 +281,15 @@ mp_scoreboard_showhealth 3 // Default value: "3" mp_scoreboard_showmoney 3 +// Show 'D. Kit' field into a scoreboard for teammates +// NOTE: If you don't want to show defuse kit field for dead enemies +// then disable this CVar or configure mp_forcecamera +// 0 - disabled +// 1 - enabled +// +// Default value: "1" +mp_scoreboard_showdefkit 1 + // How much to reduce damage done to teammates when shot. // Range is from 0 - 1 (with 1 being damage equal to what is done to an enemy) // diff --git a/regamedll/dlls/game.cpp b/regamedll/dlls/game.cpp index 434382f7..5103aaa4 100644 --- a/regamedll/dlls/game.cpp +++ b/regamedll/dlls/game.cpp @@ -98,6 +98,7 @@ cvar_t sk_scientist_heal3 = { "sk_scientist_heal3", "0", 0, 0.0f, nullptr }; cvar_t scoreboard_showmoney = { "mp_scoreboard_showmoney", "3", FCVAR_SERVER, 0.0f, nullptr }; cvar_t scoreboard_showhealth = { "mp_scoreboard_showhealth", "3", FCVAR_SERVER, 0.0f, nullptr }; +cvar_t scoreboard_showdefkit = { "mp_scoreboard_showdefkit", "1", FCVAR_SERVER, 0.0f, nullptr }; #endif @@ -253,6 +254,7 @@ void EXT_FUNC GameDLLInit() #ifdef BUILD_LATEST CVAR_REGISTER(&scoreboard_showhealth); CVAR_REGISTER(&scoreboard_showmoney); + CVAR_REGISTER(&scoreboard_showdefkit); #endif // Remove unused cvars diff --git a/regamedll/dlls/game.h b/regamedll/dlls/game.h index 9eab6281..0ed8c46b 100644 --- a/regamedll/dlls/game.h +++ b/regamedll/dlls/game.h @@ -177,5 +177,6 @@ extern cvar_t radio_maxinround; extern cvar_t scoreboard_showmoney; extern cvar_t scoreboard_showhealth; +extern cvar_t scoreboard_showdefkit; void GameDLLInit(); diff --git a/regamedll/dlls/player.cpp b/regamedll/dlls/player.cpp index 61925c47..90218103 100644 --- a/regamedll/dlls/player.cpp +++ b/regamedll/dlls/player.cpp @@ -4319,7 +4319,7 @@ void EXT_FUNC CBasePlayer::__API_HOOK(PreThink)() if (!IsBot() && flLastMove > CSGameRules()->m_fMaxIdlePeriod) { DropIdlePlayer("Player idle"); - + m_fLastMovement = gpGlobals->time; } #ifdef REGAMEDLL_ADD @@ -5183,8 +5183,24 @@ void CBasePlayer::SetScoreAttrib(CBasePlayer *dest) state |= SCORE_STATUS_VIP; #ifdef BUILD_LATEST - if (m_bHasDefuser) - state |= SCORE_STATUS_DEFKIT; + +#ifdef REGAMEDLL_FIXES + if (scoreboard_showdefkit.value) +#endif + { + if (m_bHasDefuser) + state |= SCORE_STATUS_DEFKIT; + } + +#endif + +#ifdef REGAMEDLL_FIXES + // TODO: Remove these fixes when they are implemented on the client side + if (state & (SCORE_STATUS_BOMB | SCORE_STATUS_DEFKIT) && GetForceCamera(dest) != CAMERA_MODE_SPEC_ANYONE) + { + if (CSGameRules()->PlayerRelationship(this, dest) != GR_TEAMMATE) + state &= ~(SCORE_STATUS_BOMB | SCORE_STATUS_DEFKIT); + } #endif if (gmsgScoreAttrib) @@ -7206,7 +7222,12 @@ void EXT_FUNC CBasePlayer::__API_HOOK(UpdateClientData)() } #ifdef BUILD_LATEST - if ((m_iTeam == CT || m_iTeam == TERRORIST) && + + if ( +#ifdef REGAMEDLL_FIXES + (scoreboard_showmoney.value != -1.0f || scoreboard_showhealth.value != -1.0f) && +#endif + (m_iTeam == CT || m_iTeam == TERRORIST) && (m_iLastAccount != m_iAccount || m_iLastClientHealth != m_iClientHealth || m_tmNextAccountHealthUpdate < gpGlobals->time)) { m_tmNextAccountHealthUpdate = gpGlobals->time + 5.0f; @@ -7225,15 +7246,25 @@ void EXT_FUNC CBasePlayer::__API_HOOK(UpdateClientData)() continue; #endif // REGAMEDLL_FIXES - MESSAGE_BEGIN(MSG_ONE, gmsgHealthInfo, nullptr, pPlayer->edict()); - WRITE_BYTE(entindex()); - WRITE_LONG(ShouldToShowHealthInfo(pPlayer) ? m_iClientHealth : -1 /* means that 'HP' field will be hidden */); - MESSAGE_END(); +#ifdef REGAMEDLL_FIXES + if (scoreboard_showmoney.value != -1.0f) +#endif + { + MESSAGE_BEGIN(MSG_ONE, gmsgHealthInfo, nullptr, pPlayer->edict()); + WRITE_BYTE(entindex()); + WRITE_LONG(ShouldToShowHealthInfo(pPlayer) ? m_iClientHealth : -1 /* means that 'HP' field will be hidden */); + MESSAGE_END(); + } - MESSAGE_BEGIN(MSG_ONE, gmsgAccount, nullptr, pPlayer->edict()); - WRITE_BYTE(entindex()); - WRITE_LONG(ShouldToShowAccount(pPlayer) ? m_iAccount : -1 /* means that this 'Money' will be hidden */); - MESSAGE_END(); +#ifdef REGAMEDLL_FIXES + if (scoreboard_showhealth.value != -1.0f) +#endif + { + MESSAGE_BEGIN(MSG_ONE, gmsgAccount, nullptr, pPlayer->edict()); + WRITE_BYTE(entindex()); + WRITE_LONG(ShouldToShowAccount(pPlayer) ? m_iAccount : -1 /* means that this 'Money' will be hidden */); + MESSAGE_END(); + } } m_iLastAccount = m_iAccount;