- Blood: fixed bad marker check in OperatePath

This commit is contained in:
Christoph Oelckers 2022-02-20 23:28:20 +01:00
parent a1339f014c
commit 2f55d2a1c7

View file

@ -1560,10 +1560,9 @@ void OperatePath(sectortype* pSector, EVENT event)
DBloodActor* actor; DBloodActor* actor;
assert(pSector); assert(pSector);
auto pXSector = &pSector->xs(); auto pXSector = &pSector->xs();
if (!pXSector->marker0 || !pXSector->marker1) return; if (!pXSector->marker0) return;
auto marker0 = pXSector->marker0; auto marker0 = pXSector->marker0;
auto marker1 = pXSector->marker1; int nId = marker0->xspr.data2;
int nId = marker1->xspr.data2;
BloodStatIterator it(kStatPathMarker); BloodStatIterator it(kStatPathMarker);
while ((actor = it.Next())) while ((actor = it.Next()))
@ -1577,7 +1576,7 @@ void OperatePath(sectortype* pSector, EVENT event)
// trigger marker after it gets reached // trigger marker after it gets reached
#ifdef NOONE_EXTENSIONS #ifdef NOONE_EXTENSIONS
if (gModernMap && marker1->xspr.state != 1) if (gModernMap && marker0->xspr.state != 1)
trTriggerSprite(pXSector->marker0, kCmdOn); trTriggerSprite(pXSector->marker0, kCmdOn);
#endif #endif
@ -1595,8 +1594,8 @@ void OperatePath(sectortype* pSector, EVENT event)
case kCmdOn: case kCmdOn:
pXSector->state = 0; pXSector->state = 0;
pXSector->busy = 0; pXSector->busy = 0;
AddBusy(pSector, BUSYID_7, 65536 / ClipLow((120 * marker1->xspr.busyTime) / 10, 1)); AddBusy(pSector, BUSYID_7, 65536 / ClipLow((120 * marker0->xspr.busyTime) / 10, 1));
if (marker1->xspr.data3) PathSound(pSector, marker1->xspr.data3); if (marker0->xspr.data3) PathSound(pSector, marker0->xspr.data3);
break; break;
} }
} }