- use the new RXBUCKET interface for nnext's wind code.

This commit is contained in:
Christoph Oelckers 2021-11-23 18:19:25 +01:00
parent 546dee2724
commit f0c74981fe
2 changed files with 17 additions and 15 deletions

View file

@ -1492,7 +1492,7 @@ DBloodActor* getNextIncarnation(DBloodActor* actor)
XSPRITE* pXSprite = &actor->x(); XSPRITE* pXSprite = &actor->x();
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 != SS_SPRITE) continue; if (!rxBucket[i].isActor()) continue;
auto rxactor = rxBucket[i].actor(); auto rxactor = rxBucket[i].actor();
if (actor != rxactor && rxactor->s().statnum == kStatInactive) return rxactor; if (actor != rxactor && rxactor->s().statnum == kStatInactive) return rxactor;
} }

View file

@ -1157,13 +1157,12 @@ void nnExtProcessSuperSprites()
rx = pXWind->txID; rx = pXWind->txID;
for (j = bucketHead[rx]; j < bucketHead[rx + 1]; j++) for (j = bucketHead[rx]; j < bucketHead[rx + 1]; j++)
{ {
if (rxBucket[j].type != OBJ_SECTOR) if (!rxBucket[j].isSector()) continue;
continue; auto pSector = rxBucket[j].sector();
XSECTOR* pXSector = &pSector->xs();
int index = rxBucket[j].rxindex;
XSECTOR* pXSector = &sector[index].xs();
if ((!pXSector->locked) && (fWindAlways || pXSector->windAlways || pXSector->busy)) if ((!pXSector->locked) && (fWindAlways || pXSector->windAlways || pXSector->busy))
windGenDoVerticalWind(pXWind->sysData2, index); windGenDoVerticalWind(pXWind->sysData2, sectnum(pSector));
} }
DBloodActor* pXRedir = nullptr; // check redirected TX buckets DBloodActor* pXRedir = nullptr; // check redirected TX buckets
@ -1171,13 +1170,12 @@ void nnExtProcessSuperSprites()
{ {
for (j = bucketHead[rx]; j < bucketHead[rx + 1]; j++) for (j = bucketHead[rx]; j < bucketHead[rx + 1]; j++)
{ {
if (rxBucket[j].type != OBJ_SECTOR) if (!rxBucket[j].isSector()) continue;
continue; auto pSector = rxBucket[j].sector();
XSECTOR* pXSector = &pSector->xs();
int index = rxBucket[j].rxindex;
XSECTOR* pXSector = &sector[index].xs();
if ((!pXSector->locked) && (fWindAlways || pXSector->windAlways || pXSector->busy)) if ((!pXSector->locked) && (fWindAlways || pXSector->windAlways || pXSector->busy))
windGenDoVerticalWind(pXWind->sysData2, index); windGenDoVerticalWind(pXWind->sysData2, sectnum(pSector));
} }
} }
@ -1976,8 +1974,10 @@ void windGenStopWindOnSectors(DBloodActor* sourceactor)
for (int i = bucketHead[pXSource->txID]; i < bucketHead[pXSource->txID + 1]; i++) for (int i = bucketHead[pXSource->txID]; i < bucketHead[pXSource->txID + 1]; i++)
{ {
if (rxBucket[i].type != OBJ_SECTOR) continue; if (!rxBucket[i].isSector()) continue;
XSECTOR* pXSector = &sector[rxBucket[i].rxindex].xs(); auto pSector = rxBucket[i].sector();
XSECTOR* pXSector = &pSector->xs();
if ((pXSector->state == 1 && !pXSector->windAlways) if ((pXSector->state == 1 && !pXSector->windAlways)
|| ((pSource->flags & kModernTypeFlag1) && !(pSource->flags & kModernTypeFlag2))) || ((pSource->flags & kModernTypeFlag1) && !(pSource->flags & kModernTypeFlag2)))
{ {
@ -1992,8 +1992,10 @@ void windGenStopWindOnSectors(DBloodActor* sourceactor)
{ {
for (int i = bucketHead[rx]; i < bucketHead[rx + 1]; i++) for (int i = bucketHead[rx]; i < bucketHead[rx + 1]; i++)
{ {
if (rxBucket[i].type != OBJ_SECTOR) continue; if (!rxBucket[i].isSector()) continue;
XSECTOR* pXSector = &sector[rxBucket[i].rxindex].xs(); auto pSector = rxBucket[i].sector();
XSECTOR* pXSector = &pSector->xs();
if ((pXSector->state == 1 && !pXSector->windAlways) || (pSource->flags & kModernTypeFlag2)) if ((pXSector->state == 1 && !pXSector->windAlways) || (pSource->flags & kModernTypeFlag2))
pXSector->windVel = 0; pXSector->windVel = 0;
} }