- backported sound volume fix from NBlood.

This commit is contained in:
Christoph Oelckers 2022-11-25 18:28:07 +01:00
parent 3ac8bd02f5
commit f39eaba109

View file

@ -61,7 +61,7 @@ void ambProcess(PLAYER* pPlayer)
if (actor->xspr.state) if (actor->xspr.state)
{ {
int nDist = (int)(actor->spr.pos - pPlayer->actor->spr.pos).Length(); int nDist = (int)(actor->spr.pos - pPlayer->actor->spr.pos).Length();
int vs = MulScale(actor->xspr.data4, actor->xspr.busy, 16); int vs = min(MulScale(actor->xspr.data4, actor->xspr.busy, 16), 127);
ambChannels[actor->spr.intowner].distance += ClipRange(scale(nDist, actor->xspr.data1, actor->xspr.data2, vs, 0), 0, vs); ambChannels[actor->spr.intowner].distance += ClipRange(scale(nDist, actor->xspr.data1, actor->xspr.data2, vs, 0), 0, vs);
} }
} }