mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2024-12-28 07:35:40 +03:00
Clamp moving entities' sounds volume (#751)
This commit is contained in:
parent
f050be77db
commit
db76e604df
@ -44,6 +44,15 @@ void CBasePlatTrain::KeyValue(KeyValueData *pkvd)
|
|||||||
else if (FStrEq(pkvd->szKeyName, "volume"))
|
else if (FStrEq(pkvd->szKeyName, "volume"))
|
||||||
{
|
{
|
||||||
m_volume = Q_atof(pkvd->szValue);
|
m_volume = Q_atof(pkvd->szValue);
|
||||||
|
|
||||||
|
#ifdef REGAMEDLL_FIXES
|
||||||
|
if (m_volume > 1.0)
|
||||||
|
m_volume = 1.0;
|
||||||
|
|
||||||
|
if (m_volume < 0.0)
|
||||||
|
m_volume = 0.0;
|
||||||
|
#endif
|
||||||
|
|
||||||
pkvd->fHandled = TRUE;
|
pkvd->fHandled = TRUE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -928,6 +937,14 @@ void CFuncTrackTrain::KeyValue(KeyValueData *pkvd)
|
|||||||
m_flVolume = Q_atoi(pkvd->szValue);
|
m_flVolume = Q_atoi(pkvd->szValue);
|
||||||
m_flVolume *= 0.1f;
|
m_flVolume *= 0.1f;
|
||||||
|
|
||||||
|
#ifdef REGAMEDLL_FIXES
|
||||||
|
if (m_flVolume > 1.0)
|
||||||
|
m_flVolume = 1.0;
|
||||||
|
|
||||||
|
if (m_flVolume < 0.0)
|
||||||
|
m_flVolume = 0.0;
|
||||||
|
#endif
|
||||||
|
|
||||||
pkvd->fHandled = TRUE;
|
pkvd->fHandled = TRUE;
|
||||||
}
|
}
|
||||||
else if (FStrEq(pkvd->szKeyName, "bank"))
|
else if (FStrEq(pkvd->szKeyName, "bank"))
|
||||||
|
@ -52,6 +52,14 @@ void CFuncVehicle::KeyValue(KeyValueData *pkvd)
|
|||||||
m_flVolume = Q_atoi(pkvd->szValue);
|
m_flVolume = Q_atoi(pkvd->szValue);
|
||||||
m_flVolume *= 0.1f;
|
m_flVolume *= 0.1f;
|
||||||
|
|
||||||
|
#ifdef REGAMEDLL_FIXES
|
||||||
|
if (m_flVolume > 1.0)
|
||||||
|
m_flVolume = 1.0;
|
||||||
|
|
||||||
|
if (m_flVolume < 0.0)
|
||||||
|
m_flVolume = 0.0;
|
||||||
|
#endif
|
||||||
|
|
||||||
pkvd->fHandled = TRUE;
|
pkvd->fHandled = TRUE;
|
||||||
}
|
}
|
||||||
else if (FStrEq(pkvd->szKeyName, "bank"))
|
else if (FStrEq(pkvd->szKeyName, "bank"))
|
||||||
|
Loading…
Reference in New Issue
Block a user