Ensure that amb4 sound entities loop correctly.

The sound file is 2720 milliseconds long, the code replays every 2.7
seconds. That was always very optimistic and I'm pretty sure that it
never worked really correct. With YQ2 timings have become much more
precise, we're calling the code more or less exactly after 2700 ms. The
remaining 20 ms aren't enough for the network frame, parsing it at
client side, maybe reuploading the sample and processing it in both the
sound front- and backend. This leads to slight stuttering.

Since the sample loops perfectly at every point take the save approach
and lower the replay delay to 2 seconds.

Closes yquake2/yquake2#506.
This commit is contained in:
Yamagi 2020-01-28 15:57:16 +01:00
parent 9713815e04
commit 9f2aa4b5f0

View file

@ -2897,7 +2897,7 @@ amb4_think(edict_t *ent)
return;
}
ent->nextthink = level.time + 2.7;
ent->nextthink = level.time + 2.0;
gi.sound(ent, CHAN_VOICE, amb4sound, 1, ATTN_NONE, 0);
}