mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-10 14:51:51 +00:00
- restored stopping of channel by new sound
If source actor/sector/polyobject is playing something on the selected channel, stop it before playing a new sound https://forum.zdoom.org/viewtopic.php?t=66613
This commit is contained in:
parent
ab4c792201
commit
f050a23541
1 changed files with 20 additions and 3 deletions
|
@ -527,10 +527,27 @@ FSoundChan *SoundEngine::StartSound(int type, const void *source,
|
||||||
{
|
{
|
||||||
if (chan->SourceType == type && chan->EntChannel == channel)
|
if (chan->SourceType == type && chan->EntChannel == channel)
|
||||||
{
|
{
|
||||||
if (type != SOURCE_Unattached) chan->Source = source;
|
bool foundit;
|
||||||
else
|
|
||||||
|
switch (type)
|
||||||
{
|
{
|
||||||
chan->Point[0] == pt->X && chan->Point[2] == pt->Z && chan->Point[1] == pt->Y;
|
case SOURCE_Actor:
|
||||||
|
case SOURCE_Sector:
|
||||||
|
case SOURCE_Polyobj:
|
||||||
|
foundit = chan->Source == source;
|
||||||
|
break;
|
||||||
|
case SOURCE_Unattached:
|
||||||
|
foundit = chan->Point[0] == pt->X && chan->Point[2] == pt->Z && chan->Point[1] == pt->Y;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
foundit = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (foundit)
|
||||||
|
{
|
||||||
|
StopChannel(chan);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue