diff --git a/README.md b/README.md index caf5a2eb..b8a3a7ab 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ Archive's bin directory contains 2 subdirectories, 'bugfixed' and 'pure' | mp_timelimit | 0 | - | - | Period between map rotations.
`0` means no limit | | mp_forcerespawn | 0 | 0 | - | Players will automatically respawn when killed.
`0` disabled
`>0.00001` time delay to respawn | | mp_hostage_hurtable | 1 | 0 | 1 | The hostages can take the damage.
`0` disabled
`1` enabled | -| mp_show_radioicon | 1 | 0 | 1 | Show radio icon.
`0` disabled
`1` enabled | +| mp_show_radioicon | 1 | 0 | 1 | Show radio icon.
`0` disabled
`1` enabled | | showtriggers | 0 | 0 | 1 | Debug cvar shows triggers. | | bot_deathmatch | 0 | 0 | 1 | Set's the mode for the zBot.
`0` disabled
`1` enable mode Deathmatch and not allow to do the scenario | | bot_quota_mode | normal | - | - | Determines the type of quota.
`normal` default behaviour
`fill` the server will adjust bots to keep `N` players in the game, where `N` is bot_quota | diff --git a/dist/game.cfg b/dist/game.cfg index 342c869b..d3575c0c 100644 --- a/dist/game.cfg +++ b/dist/game.cfg @@ -154,3 +154,12 @@ bot_quota_mode "normal" // // Default value: "0" showtriggers 0 + +// When teammates can hear each other. +// 0 - dead don't hear alive +// 1 - no restrictions +// 2 - teammates hear each other +// 3 - same as 2, but spectators hear everybody +// +// Default value: "0" +sv_alltalk 0 diff --git a/regamedll/dlls/multiplay_gamerules.cpp b/regamedll/dlls/multiplay_gamerules.cpp index 527447df..ade05a16 100644 --- a/regamedll/dlls/multiplay_gamerules.cpp +++ b/regamedll/dlls/multiplay_gamerules.cpp @@ -87,6 +87,18 @@ void EXT_FUNC CHalfLifeMultiplay::__API_HOOK(ServerDeactivate)() bool CCStrikeGameMgrHelper::CanPlayerHearPlayer(CBasePlayer *pListener, CBasePlayer *pSender) { +#ifdef REGAMEDLL_ADD + switch ((int)sv_alltalk.value) + { + case 2: + return (pListener->m_iTeam == pSender->m_iTeam); + case 3: + return (pListener->m_iTeam == pSender->m_iTeam || pListener->IsObserver()); + default: // HLDS Behavior + break; + } +#endif + if ( #ifndef REGAMEDLL_FIXES !pSender->IsPlayer() || diff --git a/regamedll/game_shared/voice_gamemgr.cpp b/regamedll/game_shared/voice_gamemgr.cpp index 02494183..c0dba2d2 100644 --- a/regamedll/game_shared/voice_gamemgr.cpp +++ b/regamedll/game_shared/voice_gamemgr.cpp @@ -74,6 +74,7 @@ void CVoiceGameMgr::Update(double frametime) // Only update periodically. m_UpdateInterval += frametime; + const float UPDATE_INTERVAL = 0.3f; if (m_UpdateInterval >= UPDATE_INTERVAL) UpdateMasks(); } @@ -153,7 +154,7 @@ void CVoiceGameMgr::UpdateMasks() { m_UpdateInterval = 0; - bool bAllTalk = !!(sv_alltalk.value); + bool bAllTalk = sv_alltalk.value != 0.0f; for (int iClient = 0; iClient < m_nMaxPlayers; iClient++) { diff --git a/regamedll/game_shared/voice_gamemgr.h b/regamedll/game_shared/voice_gamemgr.h index d81d3ac2..d1a6640d 100644 --- a/regamedll/game_shared/voice_gamemgr.h +++ b/regamedll/game_shared/voice_gamemgr.h @@ -28,8 +28,6 @@ #pragma once -#define UPDATE_INTERVAL 0.3 - #include "voice_common.h" class CGameRules; @@ -84,4 +82,6 @@ private: double m_UpdateInterval; // How long since the last update. }; +extern cvar_t sv_alltalk; + void VoiceServerDebug(const char *pFmt, ...);