mirror of
https://github.com/ZDoom/Raze.git
synced 2025-01-31 04:20:42 +00:00
- event redirectors for rxBuckets.
This commit is contained in:
parent
40a8cd7fa3
commit
b449e0a43b
2 changed files with 13 additions and 11 deletions
|
@ -7742,13 +7742,15 @@ int listTx(XSPRITE* pXRedir, int tx) {
|
||||||
return tx;
|
return tx;
|
||||||
}
|
}
|
||||||
|
|
||||||
XSPRITE* evrIsRedirector(int nSprite) {
|
DBloodActor* evrIsRedirector(DBloodActor* actor)
|
||||||
if (spriRangeIsFine(nSprite)) {
|
{
|
||||||
switch (sprite[nSprite].type) {
|
if (actor)
|
||||||
|
{
|
||||||
|
switch (actor->s().type)
|
||||||
|
{
|
||||||
case kModernRandomTX:
|
case kModernRandomTX:
|
||||||
case kModernSequentialTX:
|
case kModernSequentialTX:
|
||||||
if (xspriRangeIsFine(sprite[nSprite].extra) && xsprite[sprite[nSprite].extra].command == kCmdLink
|
if (actor->hasX() && actor->x().command == kCmdLink && !actor->x().locked) return actor;
|
||||||
&& !xsprite[sprite[nSprite].extra].locked) return &xsprite[sprite[nSprite].extra];
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7782,10 +7784,11 @@ XSPRITE* evrListRedirectors(int objType, int objXIndex, XSPRITE* pXRedir, int* t
|
||||||
int nIndex = (pXRedir) ? pXRedir->reference : -1; bool prevFound = false;
|
int nIndex = (pXRedir) ? pXRedir->reference : -1; bool prevFound = false;
|
||||||
for (int i = bucketHead[id]; i < bucketHead[id + 1]; i++) {
|
for (int i = bucketHead[id]; i < bucketHead[id + 1]; i++) {
|
||||||
if (rxBucket[i].type != OBJ_SPRITE) continue;
|
if (rxBucket[i].type != OBJ_SPRITE) continue;
|
||||||
XSPRITE* pXSpr = evrIsRedirector(rxBucket[i].rxindex);
|
auto rxactor = evrIsRedirector(rxBucket[i].GetActor());
|
||||||
if (!pXSpr) continue;
|
if (!rxactor || !rxactor->hasX()) continue;
|
||||||
else if (prevFound || nIndex == -1) { *tx = listTx(pXSpr, *tx); return pXSpr; }
|
|
||||||
else if (nIndex != pXSpr->reference) continue;
|
if (prevFound || nIndex == -1) { *tx = listTx(&rxactor->x(), *tx); return &rxactor->x(); }
|
||||||
|
else if (nIndex != rxactor->s().index) continue;
|
||||||
else prevFound = true;
|
else prevFound = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7799,7 +7802,7 @@ bool incDecGoalValueIsReached(XSPRITE* pXSprite) {
|
||||||
if (pXSprite->data3 != pXSprite->sysData1) return false;
|
if (pXSprite->data3 != pXSprite->sysData1) return false;
|
||||||
char buffer[5]; sprintf(buffer, "%d", abs(pXSprite->data1)); int len = int(strlen(buffer)); int rx = -1;
|
char buffer[5]; sprintf(buffer, "%d", abs(pXSprite->data1)); int len = int(strlen(buffer)); int rx = -1;
|
||||||
for (int i = bucketHead[pXSprite->txID]; i < bucketHead[pXSprite->txID + 1]; i++) {
|
for (int i = bucketHead[pXSprite->txID]; i < bucketHead[pXSprite->txID + 1]; i++) {
|
||||||
if (rxBucket[i].type == OBJ_SPRITE && evrIsRedirector(rxBucket[i].rxindex)) continue;
|
if (rxBucket[i].type == OBJ_SPRITE && evrIsRedirector(rxBucket[i].GetActor())) continue;
|
||||||
for (int a = 0; a < len; a++) {
|
for (int a = 0; a < len; a++) {
|
||||||
if (getDataFieldOfObject(rxBucket[i].type, rxBucket[i].rxindex, (buffer[a] - 52) + 4) != pXSprite->data3)
|
if (getDataFieldOfObject(rxBucket[i].type, rxBucket[i].rxindex, (buffer[a] - 52) + 4) != pXSprite->data3)
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -418,7 +418,6 @@ bool condCheckPlayer(XSPRITE* pXCond, int cmpOp, bool PUSH);
|
||||||
bool condCheckDude(XSPRITE* pXCond, int cmpOp, bool PUSH);
|
bool condCheckDude(XSPRITE* pXCond, int cmpOp, bool PUSH);
|
||||||
void condUpdateObjectIndex(int objType, int oldIndex, int newIndex);
|
void condUpdateObjectIndex(int objType, int oldIndex, int newIndex);
|
||||||
XSPRITE* evrListRedirectors(int objType, int objXIndex, XSPRITE* pXRedir, int* tx);
|
XSPRITE* evrListRedirectors(int objType, int objXIndex, XSPRITE* pXRedir, int* tx);
|
||||||
XSPRITE* evrIsRedirector(int nSprite);
|
|
||||||
int listTx(XSPRITE* pXRedir, int tx);
|
int listTx(XSPRITE* pXRedir, int tx);
|
||||||
void seqSpawnerOffSameTx(XSPRITE* pXSource);
|
void seqSpawnerOffSameTx(XSPRITE* pXSource);
|
||||||
// ------------------------------------------------------------------------- //
|
// ------------------------------------------------------------------------- //
|
||||||
|
|
Loading…
Reference in a new issue