Skip to content

Commit

Permalink
Closes #157
Browse files Browse the repository at this point in the history
  • Loading branch information
s1lentq committed Nov 1, 2017
1 parent b7208e9 commit 875189f
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Archive's bin directory contains 2 subdirectories, 'bugfixed' and 'pure'
| mp_timelimit | 0 | - | - | Period between map rotations.<br />`0` means no limit |
| mp_forcerespawn | 0 | 0 | - | Players will automatically respawn when killed.<br/>`0` disabled<br/>`>0.00001` time delay to respawn |
| mp_hostage_hurtable | 1 | 0 | 1 | The hostages can take the damage.<br/>`0` disabled<br/>`1` enabled |
| mp_show_radioicon | 1 | 0 | 1 | Show radio icon.<br/>`0` disabled<br/>`1` enabled |
| mp_show_radioicon | 1 | 0 | 1 | Show radio icon.<br/>`0` disabled<br/>`1` enabled |
| showtriggers | 0 | 0 | 1 | Debug cvar shows triggers. |
| bot_deathmatch | 0 | 0 | 1 | Set's the mode for the zBot.<br/>`0` disabled<br/>`1` enable mode Deathmatch and not allow to do the scenario |
| bot_quota_mode | normal | - | - | Determines the type of quota.<br/>`normal` default behaviour<br/>`fill` the server will adjust bots to keep `N` players in the game, where `N` is bot_quota |
Expand Down
9 changes: 9 additions & 0 deletions dist/game.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
12 changes: 12 additions & 0 deletions regamedll/dlls/multiplay_gamerules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() ||
Expand Down
3 changes: 2 additions & 1 deletion regamedll/game_shared/voice_gamemgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down Expand Up @@ -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++)
{
Expand Down
4 changes: 2 additions & 2 deletions regamedll/game_shared/voice_gamemgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@

#pragma once

#define UPDATE_INTERVAL 0.3

#include "voice_common.h"

class CGameRules;
Expand Down Expand Up @@ -84,4 +82,6 @@ class CVoiceGameMgr
double m_UpdateInterval; // How long since the last update.
};

extern cvar_t sv_alltalk;

void VoiceServerDebug(const char *pFmt, ...);

0 comments on commit 875189f

Please sign in to comment.