mirror of
https://github.com/mapbase-source/source-sdk-2013.git
synced 2024-12-26 06:45:31 +03:00
Added a separate "host_pitchscale" cvar which can override host_timescale's sound pitch scaling
This commit is contained in:
parent
fc93d736ee
commit
e39e1e0cca
@ -132,12 +132,18 @@ void Hack_FixEscapeChars( char *str )
|
||||
|
||||
#ifdef MAPBASE
|
||||
static const ConVar *pHostTimescale;
|
||||
static ConVar host_pitchscale( "host_pitchscale", "-1", FCVAR_REPLICATED, "If greater than 0, controls the pitch scale of sounds instead of host_timescale." );
|
||||
|
||||
static float GetSoundPitchScale()
|
||||
{
|
||||
static ConVarRef sv_cheats( "sv_cheats" );
|
||||
if (sv_cheats.GetBool())
|
||||
return pHostTimescale->GetFloat();
|
||||
{
|
||||
if (host_pitchscale.GetFloat() > 0.0f)
|
||||
return host_pitchscale.GetFloat();
|
||||
else
|
||||
return pHostTimescale->GetFloat();
|
||||
}
|
||||
|
||||
return 1.0f;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user