- Fixed: Closing doors early would never restart the sound sequence if it was manually placed.

SVN r2150 (trunk)
This commit is contained in:
Randy Heit 2010-02-02 05:19:43 +00:00
commit ecb9d2f24b
3 changed files with 32 additions and 12 deletions

View file

@ -952,6 +952,33 @@ static int FindSequence (FName seqname)
return -1;
}
//==========================================================================
//
// SN_CheckSequence
//
// Returns the sound sequence playing in the sector on the given channel,
// if any.
//
//==========================================================================
DSeqNode *SN_CheckSequence(sector_t *sector, int chan)
{
for (DSeqNode *node = DSeqNode::FirstSequence(); node; )
{
DSeqNode *next = node->NextSequence();
if (node->Source() == sector)
{
assert(node->IsKindOf(RUNTIME_CLASS(DSeqSectorNode)));
if ((static_cast<DSeqSectorNode *>(node)->Channel & 7) == chan)
{
return node;
}
}
node = next;
}
return NULL;
}
//==========================================================================
//
// SN_StopSequence
@ -965,20 +992,10 @@ void SN_StopSequence (AActor *actor)
void SN_StopSequence (sector_t *sector, int chan)
{
DSeqNode *node;
for (node = DSeqNode::FirstSequence(); node; )
DSeqNode *node = SN_CheckSequence(sector, chan);
if (node != NULL)
{
DSeqNode *next = node->NextSequence();
if (node->Source() == sector)
{
assert(node->IsKindOf(RUNTIME_CLASS(DSeqSectorNode)));
if ((static_cast<DSeqSectorNode *>(node)->Channel & 7) == chan)
{
node->StopAndDestroy ();
}
}
node = next;
node->StopAndDestroy();
}
}