Commit cc924eeb authored by Richard Gobeille's avatar Richard Gobeille
Browse files

Duke3d: fix sound regression causing sound #0 (KICK_HIT) to play when doors were opened

parent f456eb37
......@@ -1671,7 +1671,7 @@ ACTOR_STATIC void G_MoveFX(void)
T1(spriteNum) = 0;
}
}
else if (pSprite->lotag < 999 && S_SoundIsValid(pSprite->lotag) && (unsigned)sector[pSprite->sectnum].lotag < 9 && // ST_9_SLIDING_ST_DOOR
else if (pSprite->lotag < 999 && pSprite->lotag && S_SoundIsValid(pSprite->lotag) && (unsigned)sector[pSprite->sectnum].lotag < 9 && // ST_9_SLIDING_ST_DOOR
ud.config.AmbienceToggle && sector[SECT(spriteNum)].floorz != sector[SECT(spriteNum)].ceilingz)
{
if (g_sounds[pSprite->lotag]->flags & SF_MSFX)
......
......@@ -36,7 +36,7 @@ int S_FindMusicSFX(int sectNum, int *sndptr)
const int32_t snd = sprite[spriteNum].lotag;
EDUKE32_STATIC_ASSERT(MAXSOUNDS >= 1000);
if (PN(spriteNum) == MUSICANDSFX && (unsigned)snd < 1000 && S_SoundIsValid(snd)) // XXX: in other places, 999
if (PN(spriteNum) == MUSICANDSFX && snd && (unsigned)snd < 1000 && S_SoundIsValid(snd)) // XXX: in other places, 999
{
*sndptr = snd;
return spriteNum;
......@@ -1489,7 +1489,7 @@ int P_ActivateSwitch(int playerNum, int wallOrSprite, int switchType)
if (!hitag && CheckDoorTile(nSwitchPicnum) == 0)
S_PlaySound3D(SWITCH_ON, (switchType == SWITCH_SPRITE) ? wallOrSprite : g_player[playerNum].ps->i, davector);
else if (S_SoundIsValid(hitag))
else if (hitag && S_SoundIsValid(hitag))
{
if (switchType == SWITCH_SPRITE && (g_sounds[hitag]->flags & SF_TALK) == 0)
S_PlaySound3D(hitag, wallOrSprite, davector);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment