mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2025-04-15 14:02:27 +03:00
Closes #157
This commit is contained in:
parent
b7208e9fbc
commit
875189fa24
9
dist/game.cfg
vendored
9
dist/game.cfg
vendored
@ -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
|
||||
|
@ -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() ||
|
||||
|
@ -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++)
|
||||
{
|
||||
|
@ -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, ...);
|
||||
|
Loading…
x
Reference in New Issue
Block a user