Don't spam splash sounds on the rollout rock

This commit is contained in:
lachwright 2019-10-12 04:35:51 +08:00
parent 1560453797
commit a01373741b

View file

@ -14246,15 +14246,13 @@ void A_RolloutRock(mobj_t *actor)
actor->momz += flip * FixedMul(locvar2, actor->scale);
if (actor->threshold)
actor->threshold--;
if (flip*prevmomz < 0 && flip*actor->momz >= 0)
if (flip*prevmomz < 0 && flip*actor->momz >= 0 && !actor->threshold)
{
if (actor->eflags & MFE_UNDERWATER)
S_StartSound(actor, sfx_splash);
else if (!actor->threshold)
{
S_StartSound(actor, sfx_splish);
actor->threshold = max((topspeed - speed) >> FRACBITS, 0);
}
actor->threshold = max((topspeed - speed) >> FRACBITS, 8);
}
}