From d275f94b0d9697a5424426ebf04e463f159ce3a0 Mon Sep 17 00:00:00 2001 From: h0mev Date: Sun, 28 Jul 2024 13:48:22 +0800 Subject: [PATCH 1/2] Add new `Cvar` to control whether `scoreboard_bug` is enabled --- README.md | 1 + dist/game.cfg | 9 +++++++++ regamedll/dlls/game.cpp | 4 ++++ regamedll/dlls/game.h | 2 ++ regamedll/dlls/player.cpp | 18 ++++++++++++++---- 5 files changed, 30 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e5b55c0cf..b6157755a 100644 --- a/README.md +++ b/README.md @@ -117,6 +117,7 @@ This means that plugins that do binary code analysis (Orpheu for example) probab | mp_freezetime_jump | 1 | 0 | 1 | Allow players to jump during freezetime.
`0` disabled
`1` enabled | | mp_defuser_allocation | 0 | 0 | 2 | Give defuser on player spawn.
`0` disabled
`1` Random players.
`2` All players. | | mp_location_area_info | 0 | 0 | 3 | Enable location area info.
`0` disabled
`1` show location below HUD radar.
`2` show location in HUD chat. `NOT RECOMMENDED!` [:speech_balloon:](## "Not all client builds are compatible")
`3` both displayed. `NOT RECOMMENDED!` [:speech_balloon:](## "Not all client builds are compatible")

`NOTE`: Navigation `maps/.nav` file required and should contain place names
`NOTE`: If option `2` or `3` is enabled, be sure to enable `mp_chat_loc_fallback 1` | +| mp_scoreboard_fix | 0 | 0 | 1 | Enable ReGameDLL scoreboard bug fix(Dead players could see the bomb or defuse kit).
`0` disabled
`1` enabled
`NOTE`: Absolutely cannot fix it in "CNCS😂" | ## How to install zBot for CS 1.6? diff --git a/dist/game.cfg b/dist/game.cfg index e6510f345..468bc6697 100644 --- a/dist/game.cfg +++ b/dist/game.cfg @@ -587,3 +587,12 @@ mp_defuser_allocation "0" // // Default value: "0" mp_location_area_info "0" + +// Enable ReGameDLL scoreboard bug fix(Dead players could see the bomb or defuse kit) +// 0 - disable +// 1 - enabled +// +// NOTE: Absolutely cannot fix it in "CNCS😂" +// +// Default value "0" +mp_scoreboard_fix "0" diff --git a/regamedll/dlls/game.cpp b/regamedll/dlls/game.cpp index 8d781724d..6d09e3bc2 100644 --- a/regamedll/dlls/game.cpp +++ b/regamedll/dlls/game.cpp @@ -181,6 +181,8 @@ cvar_t defuser_allocation = { "mp_defuser_allocation", "0", 0, 0.0f, nullpt cvar_t location_area_info = { "mp_location_area_info", "0", 0, 0.0f, nullptr }; cvar_t chat_loc_fallback = { "mp_chat_loc_fallback", "1", 1, 0.0f, nullptr }; +cvar_t scoreboard_fix = { "mp_scoreboard_fix", "0", FCVAR_SERVER, 0.0f, nullptr }; + void GameDLL_Version_f() { if (Q_stricmp(CMD_ARGV(1), "version") != 0) @@ -446,6 +448,8 @@ void EXT_FUNC GameDLLInit() CVAR_REGISTER(&location_area_info); CVAR_REGISTER(&chat_loc_fallback); + CVAR_REGISTER(&scoreboard_fix); + // print version CONSOLE_ECHO("ReGameDLL version: " APP_VERSION "\n"); diff --git a/regamedll/dlls/game.h b/regamedll/dlls/game.h index dcd712f5e..92d8eb1db 100644 --- a/regamedll/dlls/game.h +++ b/regamedll/dlls/game.h @@ -204,6 +204,8 @@ extern cvar_t defuser_allocation; extern cvar_t location_area_info; extern cvar_t chat_loc_fallback; +extern cvar_t scoreboard_fix; + #endif extern cvar_t scoreboard_showmoney; diff --git a/regamedll/dlls/player.cpp b/regamedll/dlls/player.cpp index 38605ebaa..d56f02545 100644 --- a/regamedll/dlls/player.cpp +++ b/regamedll/dlls/player.cpp @@ -5548,11 +5548,21 @@ void CBasePlayer::SetScoreAttrib(CBasePlayer *dest) #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 ( +#ifdef REGAMEDLL_ADD + scoreboard_fix.value +#else + false +#endif + ) { - if (CSGameRules()->PlayerRelationship(this, dest) != GR_TEAMMATE) - state &= ~(SCORE_STATUS_BOMB | SCORE_STATUS_DEFKIT); + // 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 From 1bd2c55ce4a8cf2025bfe198d74b56dc1461bd79 Mon Sep 17 00:00:00 2001 From: Eason <62255465+jonathan-up@users.noreply.github.com> Date: Sun, 4 Aug 2024 16:44:21 +0800 Subject: [PATCH 2/2] Cvar sv_allchat 2 to set spectator text message visible dead only (#17) --- README.md | 2 +- dist/game.cfg | 1 + regamedll/dlls/client.cpp | 11 +++++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0ad6361ae..6f600bf54 100644 --- a/README.md +++ b/README.md @@ -103,7 +103,7 @@ This means that plugins that do binary code analysis (Orpheu for example) probab | mp_team_flash | 1 | -1 | 1 | Sets the behaviour for Flashbangs on teammates.
`-1` Don't affect teammates neither flash owner
`0` Don't affect teammates
`1` Affects teammates | | mp_fadetoblack | 0 | 0 | 2 | Observer's screen will fade to black on kill event or permanent.
`0` No fade.
`1` Fade to black and won't be able to watch anybody.
`2` fade to black only on kill moment. | | mp_falldamage | 1 | 0 | 1 | Damage from falling.
`0` disabled
`1` enabled | -| sv_allchat | 1 | 0 | 1 | Players can receive all other players text chat, team restrictions apply
`0` disabled
`1` enabled | +| sv_allchat | 1 | 0 | 1 | Players can receive all other players text chat, team restrictions apply
`0` disabled
`1` enabled
`2` enabled, but only dead player can see spectator's message | | sv_autobunnyhopping | 0 | 0 | 1 | Players automatically re-jump while holding jump button.
`0` disabled
`1` enabled | | sv_enablebunnyhopping | 0 | 0 | 1 | Allow player speed to exceed maximum running speed.
`0` disabled
`1` enabled | | mp_plant_c4_anywhere | 0 | 0 | 1 | When set, players can plant anywhere, not only in bombsites.
`0` disabled
`1` enabled | diff --git a/dist/game.cfg b/dist/game.cfg index 96e313aa4..2541ac75c 100644 --- a/dist/game.cfg +++ b/dist/game.cfg @@ -485,6 +485,7 @@ mp_team_flash "1" // Players can receive all other players text chat, team restrictions apply. // 0 - disabled (default behaviour) // 1 - enabled +// 2 - enabled, but only dead player can see spectator'smessage // // Default value: "0" sv_allchat "0" diff --git a/regamedll/dlls/client.cpp b/regamedll/dlls/client.cpp index 7d3fb659e..961175644 100644 --- a/regamedll/dlls/client.cpp +++ b/regamedll/dlls/client.cpp @@ -1010,6 +1010,17 @@ void Host_Say(edict_t *pEntity, BOOL teamonly) continue; } + // when allchat is 2,only dead player can see spectator's message + if ( +#ifdef REGAMEDLL_ADD + allchat.value == 2.0f && +#endif + (pPlayer->m_iTeam == UNASSIGNED || pPlayer->m_iTeam == SPECTATOR) + ) { + if (pReceiver->pev->deadflag == DEAD_NO) + continue; + } + if ((pReceiver->m_iIgnoreGlobalChat == IGNOREMSG_ENEMY && pReceiver->m_iTeam == pPlayer->m_iTeam) || pReceiver->m_iIgnoreGlobalChat == IGNOREMSG_NONE) {