mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-15 08:51:24 +00:00
Do not mess up random seed in seq/qav
This commit is contained in:
parent
935084ae52
commit
e999e2058c
2 changed files with 20 additions and 7 deletions
|
@ -94,7 +94,7 @@ void QAV::Play(int start, int end, int nCallback, void *pData)
|
|||
SOUNDINFO *pSound = &pFrame->sound;
|
||||
|
||||
// by NoOne: handle Sound kill flags
|
||||
if (pSound->sndFlags > 0 && pSound->sndFlags <= kFlagSoundKillAll) {
|
||||
if (!VanillaMode() && pSound->sndFlags > 0 && pSound->sndFlags <= kFlagSoundKillAll) {
|
||||
for (int i = 0; i < nFrames; i++) {
|
||||
FRAMEINFO* pFrame2 = &frames[i];
|
||||
SOUNDINFO* pSound2 = &pFrame2->sound;
|
||||
|
@ -112,9 +112,14 @@ void QAV::Play(int start, int end, int nCallback, void *pData)
|
|||
}
|
||||
|
||||
if (pSound->sound > 0) {
|
||||
int sndRange = pSound->sndRange;
|
||||
if (nSprite == -1) PlaySound(pSound->sound + Random((sndRange == 1) ? 2 : sndRange));
|
||||
else PlaySound3D(&sprite[nSprite], pSound->sound + Random((sndRange == 1) ? 2 : sndRange), 16+pSound->priority, 6);
|
||||
int sound = pSound->sound;
|
||||
|
||||
// by NoOne: add random rage sound feature
|
||||
if (pSound->sndRange > 0 && !VanillaMode())
|
||||
sound += Random((pSound->sndRange == 1) ? 2 : pSound->sndRange);
|
||||
|
||||
if (nSprite == -1) PlaySound(sound);
|
||||
else PlaySound3D(&sprite[nSprite], sound, 16+pSound->priority, 6);
|
||||
}
|
||||
|
||||
if (pFrame->nCallbackId > 0 && nCallback != -1) {
|
||||
|
|
|
@ -287,11 +287,19 @@ void SEQINST::Update(ACTIVE *pActive)
|
|||
{
|
||||
|
||||
UpdateSprite(pActive->xindex, &pSequence->frames[frameIndex]);
|
||||
if (pSequence->frames[frameIndex].at6_1)
|
||||
sfxPlay3DSound(&sprite[xsprite[pActive->xindex].reference], pSequence->ata + Random(pSequence->frames[frameIndex].soundRange), -1, 0);
|
||||
if (pSequence->frames[frameIndex].at6_1) {
|
||||
|
||||
int sound = pSequence->ata;
|
||||
|
||||
// by NoOne: add random sound range feature
|
||||
if (!VanillaMode() && pSequence->frames[frameIndex].soundRange > 0)
|
||||
sound += Random(((pSequence->frames[frameIndex].soundRange == 1) ? 2 : pSequence->frames[frameIndex].soundRange));
|
||||
|
||||
sfxPlay3DSound(&sprite[xsprite[pActive->xindex].reference], sound, -1, 0);
|
||||
}
|
||||
|
||||
spritetype* pSprite = &sprite[xsprite[pActive->xindex].reference];
|
||||
if (pSequence->frames[frameIndex].surfaceSound && zvel[pSprite->xvel] == 0 && xvel[pSprite->xvel] != 0) {
|
||||
if (!VanillaMode() && pSequence->frames[frameIndex].surfaceSound && zvel[pSprite->xvel] == 0 && xvel[pSprite->xvel] != 0) {
|
||||
|
||||
// by NoOne: add surfaceSound trigger feature
|
||||
if (gUpperLink[pSprite->sectnum] >= 0) break; // don't play surface sound for stacked sectors
|
||||
|
|
Loading…
Reference in a new issue