From f077d575471a19e9abfbe24dbc06626786b7c730 Mon Sep 17 00:00:00 2001 From: helixhorned Date: Sat, 22 Feb 2014 19:38:53 +0000 Subject: [PATCH] Amend r3822 ("Make deletion of an amb. sound MUSICANDSFX stop its sound again.") We shouldn't be using its actor[].t_data[8] because that one is used by the sprite rotation-fixing system (which fixes STAT_FX sprites to the positions relative to the pivot, too). Test case source/lunatic/test/delmusicsfx.lua still passes with this modification. git-svn-id: https://svn.eduke32.com/eduke32@4352 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/actors.c | 7 +++---- polymer/eduke32/source/sounds.c | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/polymer/eduke32/source/actors.c b/polymer/eduke32/source/actors.c index 16f761a3d..28fcf4698 100644 --- a/polymer/eduke32/source/actors.c +++ b/polymer/eduke32/source/actors.c @@ -606,7 +606,7 @@ void A_DeleteSprite(int32_t s) A_DeleteLight(s); #endif - if (sprite[s].picnum == MUSICANDSFX && actor[s].t_data[8]==1) + if (sprite[s].picnum == MUSICANDSFX && actor[s].t_data[0]==1) { // AMBIENT_SFX_PLAYING S_StopEnvSound(sprite[s].lotag, s); @@ -1417,15 +1417,14 @@ ACTOR_STATIC void G_MoveFX(void) g_sounds[s->lotag].m |= SF_LOOP; A_PlaySound(s->lotag,i); g_sounds[s->lotag].m = om; - T1 = 1; - T9 = 1; // AMBIENT_SFX_PLAYING + T1 = 1; // AMBIENT_SFX_PLAYING } else if (x >= ht && T1 == 1) { // Stop playing ambience sound because we're out of its range. + // T1 will be reset in sounds.c: CLEAR_SOUND_T0 // T1 = 0; - T9 = 0; S_StopEnvSound(s->lotag,i); } } diff --git a/polymer/eduke32/source/sounds.c b/polymer/eduke32/source/sounds.c index c23898893..0372bddfa 100644 --- a/polymer/eduke32/source/sounds.c +++ b/polymer/eduke32/source/sounds.c @@ -363,8 +363,8 @@ void S_Cleanup(void) g_sounds[num].num--; // MUSICANDSFX uses t_data[0] to control restarting the sound - // ST_2_UNDERWATER - if (i != -1 && S_IsAmbientSFX(i) && sector[sprite[i].sectnum].lotag < 3) + // CLEAR_SOUND_T0 + if (i != -1 && S_IsAmbientSFX(i) && sector[sprite[i].sectnum].lotag < 3) // ST_2_UNDERWATER actor[i].t_data[0] = 0; g_sounds[num].SoundOwner[j].ow = -1;