- evrListRedirectors

The wall/sector parts of this look currently unused,
This commit is contained in:
Christoph Oelckers 2021-11-19 16:56:58 +01:00
parent b23a2865b8
commit db9d12d19f
2 changed files with 17 additions and 11 deletions

View file

@ -4873,7 +4873,7 @@ void modernTypeTrigger(int destObjType, int destObjIndex, DBloodActor* destactor
// change sector lighting dynamically // change sector lighting dynamically
case kModernSectorFXChanger: case kModernSectorFXChanger:
if (destObjType != OBJ_SECTOR) break; if (destObjType != OBJ_SECTOR) break;
useSectorLigthChanger(event.actor, &sector[destObjIndex]); useSectorLightChanger(event.actor, &sector[destObjIndex]);
break; break;
// change target of dudes and make it fight // change target of dudes and make it fight
case kModernDudeTargetChanger: case kModernDudeTargetChanger:
@ -6746,7 +6746,7 @@ void useDataChanger(DBloodActor* sourceactor, int objType, int objIndex, DBloodA
// //
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void useSectorLigthChanger(DBloodActor* sourceactor, sectortype* pSector) void useSectorLightChanger(DBloodActor* sourceactor, sectortype* pSector)
{ {
auto pXSource = &sourceactor->x(); auto pXSource = &sourceactor->x();
spritetype* pSource = &sourceactor->s(); spritetype* pSource = &sourceactor->s();
@ -8925,9 +8925,9 @@ DBloodActor* evrIsRedirector(DBloodActor* actor)
// //
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
DBloodActor* evrListRedirectors(int objType, int objXIndex, DBloodActor* objActor, DBloodActor* pXRedir, int* tx) DBloodActor* evrListRedirectors(int objType, int objIndex, DBloodActor* objActor, DBloodActor* pXRedir, int* tx)
{ {
if (!gEventRedirectsUsed) return NULL; if (!gEventRedirectsUsed) return nullptr;
else if (pXRedir && (*tx = listTx(pXRedir, *tx)) != -1) else if (pXRedir && (*tx = listTx(pXRedir, *tx)) != -1)
return pXRedir; return pXRedir;
@ -8935,19 +8935,25 @@ DBloodActor* evrListRedirectors(int objType, int objXIndex, DBloodActor* objActo
switch (objType) switch (objType)
{ {
case OBJ_SECTOR: case OBJ_SECTOR:
if (!xsectRangeIsFine(objXIndex)) return NULL; {
id = xsector[objXIndex].txID; auto pSector = &sector[objIndex];
if (!pSector->hasX()) return nullptr;
id = sector[objIndex].xs().txID;
break; break;
}
case OBJ_SPRITE: case OBJ_SPRITE:
if (!objActor) return NULL; if (!objActor) return nullptr;
id = objActor->x().txID; id = objActor->x().txID;
break; break;
case OBJ_WALL: case OBJ_WALL:
if (!xwallRangeIsFine(objXIndex)) return NULL; {
id = xwall[objXIndex].txID; auto pWall = &wall[objIndex];
if (!pWall->hasX()) return nullptr;
id = wall[objIndex].xw().txID;
break; break;
}
default: default:
return NULL; return nullptr;
} }
bool prevFound = false; bool prevFound = false;

View file

@ -321,7 +321,7 @@ void useUniMissileGen(DBloodActor* sourceactor, DBloodActor* actor);
void useSoundGen(DBloodActor* sourceactor, DBloodActor* actor); void useSoundGen(DBloodActor* sourceactor, DBloodActor* actor);
void useIncDecGen(DBloodActor* sourceactor, short objType, int objIndex, DBloodActor* objactor); void useIncDecGen(DBloodActor* sourceactor, short objType, int objIndex, DBloodActor* objactor);
void useDataChanger(DBloodActor* sourceactor, int objType, int objIndex, DBloodActor* objActor); void useDataChanger(DBloodActor* sourceactor, int objType, int objIndex, DBloodActor* objActor);
void useSectorLigthChanger(DBloodActor* pXSource, sectortype* pSector); void useSectorLightChanger(DBloodActor* pXSource, sectortype* pSector);
void useTargetChanger(DBloodActor* sourceactor, DBloodActor* actor); void useTargetChanger(DBloodActor* sourceactor, DBloodActor* actor);
void usePictureChanger(DBloodActor* sourceactor, int objType, int objIndex, DBloodActor* objActor); void usePictureChanger(DBloodActor* sourceactor, int objType, int objIndex, DBloodActor* objActor);
void useSequentialTx(DBloodActor* pXSource, COMMAND_ID cmd, bool setState); void useSequentialTx(DBloodActor* pXSource, COMMAND_ID cmd, bool setState);