mirror of
https://github.com/ZDoom/Raze.git
synced 2025-01-18 22:51:50 +00:00
- eliminated most references to spritetype::extra
This was all places that could have been done earlier but had been overlooked.
This commit is contained in:
parent
3d63c44aae
commit
21a208e59e
10 changed files with 21 additions and 28 deletions
|
@ -51,7 +51,6 @@ void collectTSpritesForPortal(int x, int y, int i, int interpolation)
|
|||
pTSprite->cstat = pSprite->cstat;
|
||||
pTSprite->statnum = kStatDecoration;
|
||||
pTSprite->owner = pSprite->index;
|
||||
pTSprite->extra = pSprite->extra;
|
||||
pTSprite->flags = pSprite->hitag | 0x200;
|
||||
pTSprite->x = dx + interpolatedvalue(pSprite->ox, pSprite->x, interpolation);
|
||||
pTSprite->y = dy + interpolatedvalue(pSprite->oy, pSprite->y, interpolation);
|
||||
|
|
|
@ -2407,7 +2407,7 @@ static void actInitThings()
|
|||
break;
|
||||
case kThingBloodChunks:
|
||||
{
|
||||
SEQINST* pInst = GetInstance(3, pSprite->extra);
|
||||
SEQINST* pInst = GetInstance(act);
|
||||
if (pInst)
|
||||
{
|
||||
auto seq = getSequence(pInst->nSeqID);
|
||||
|
@ -3929,7 +3929,7 @@ static void actImpactMissile(DBloodActor* missileActor, int hitCode)
|
|||
}
|
||||
}
|
||||
|
||||
if (pMissile->extra > 0)
|
||||
if (missileActor->hasX())
|
||||
{
|
||||
actPostSprite(missileActor, kStatDecoration);
|
||||
if (pMissile->ang == 1024) sfxPlay3DSound(pMissile, 307, -1, 0);
|
||||
|
@ -7341,7 +7341,6 @@ void MakeSplash(DBloodActor* actor)
|
|||
auto pXSprite = &actor->x();
|
||||
auto pSprite = &actor->s();
|
||||
pSprite->flags &= ~2;
|
||||
int nXSprite = pSprite->extra;
|
||||
pSprite->z -= 4 << 8;
|
||||
int nSurface = tileGetSurfType(actor->hit.florhit);
|
||||
switch (pSprite->type)
|
||||
|
|
|
@ -113,7 +113,7 @@ void StompSeqCallback(int, DBloodActor* actor1)
|
|||
if (actor1 != actor2 || v4)
|
||||
{
|
||||
spritetype* pSprite2 = &actor2->s();
|
||||
if (pSprite2->extra > 0 && pSprite2->extra < kMaxXSprites)
|
||||
if (actor2->hasX())
|
||||
{
|
||||
if (pSprite2->type == kDudeBeast)
|
||||
continue;
|
||||
|
|
|
@ -1848,7 +1848,7 @@ void dudeLeechOperate(DBloodActor* actor, const EVENT& event)
|
|||
if (actTarget != nullptr && actTarget != actor->GetOwner())
|
||||
{
|
||||
spritetype* pTarget = &actTarget->s();
|
||||
if (pTarget->statnum == kStatDude && !(pTarget->flags & 32) && pTarget->extra > 0 && pTarget->extra < kMaxXSprites && !pXSprite->stateTimer)
|
||||
if (pTarget->statnum == kStatDude && !(pTarget->flags & 32) && actTarget->hasX() && !pXSprite->stateTimer)
|
||||
{
|
||||
if (IsPlayerSprite(pTarget))
|
||||
{
|
||||
|
@ -1908,7 +1908,7 @@ bool doExplosion(DBloodActor* actor, int nType)
|
|||
auto actExplosion = actSpawnSprite(pSprite->sectnum, pSprite->x, pSprite->y, pSprite->z, kStatExplosion, true);
|
||||
auto const pExplosion = &actExplosion->s();
|
||||
auto const pXExplosion = &actExplosion->x();
|
||||
if (pExplosion->extra < 0 || pExplosion->extra >= kMaxXSprites)
|
||||
if (!actExplosion->hasX())
|
||||
return false;
|
||||
|
||||
int nSeq = 4; int nSnd = 304; const EXPLOSION* pExpl = &explodeInfo[nType];
|
||||
|
|
|
@ -134,8 +134,7 @@ void fxZombieBloodSpurt(DBloodActor* actor, int) // 5
|
|||
{
|
||||
if (!actor) return;
|
||||
spritetype *pSprite = &actor->s();
|
||||
int nXSprite = pSprite->extra;
|
||||
assert(nXSprite > 0 && nXSprite < kMaxXSprites);
|
||||
assert(actor->hasX());
|
||||
XSPRITE *pXSprite = &actor->x();
|
||||
int top, bottom;
|
||||
GetSpriteExtents(pSprite, &top, &bottom);
|
||||
|
@ -215,7 +214,7 @@ void Respawn(DBloodActor* actor, int) // 9
|
|||
{
|
||||
if (!actor) return;
|
||||
spritetype *pSprite = &actor->s();
|
||||
assert(pSprite->extra > 0 && pSprite->extra < kMaxXSprites);
|
||||
assert(actor->hasX());
|
||||
XSPRITE *pXSprite = &actor->x();
|
||||
|
||||
if (pSprite->statnum != kStatRespawn && pSprite->statnum != kStatThing) {
|
||||
|
@ -475,7 +474,7 @@ void sleeveStopBouncing(DBloodActor* actor)
|
|||
{
|
||||
auto pSprite = &actor->s();
|
||||
actor->xvel = actor->yvel = actor->zvel = 0;
|
||||
if (pSprite->extra > 0) seqKill(actor);
|
||||
if (actor->hasX()) seqKill(actor);
|
||||
sfxKill3DSound(pSprite, -1, -1);
|
||||
|
||||
switch (pSprite->type) {
|
||||
|
@ -639,8 +638,7 @@ void DropVoodooCb(DBloodActor* actor, int) // unused
|
|||
return;
|
||||
}
|
||||
pSprite->ang = getangle(pOwner->x-pSprite->x, pOwner->y-pSprite->y);
|
||||
int nXSprite = pSprite->extra;
|
||||
if (nXSprite > 0)
|
||||
if (actor->hasX())
|
||||
{
|
||||
XSPRITE *pXSprite = &actor->x();
|
||||
if (pXSprite->data1 == 0)
|
||||
|
|
|
@ -186,6 +186,7 @@ int InsertSprite(int nSector, int nStat)
|
|||
}
|
||||
RemoveSpriteStat(nSprite);
|
||||
DBloodActor* actor = &bloodActors[nSprite];
|
||||
actor->Clear();
|
||||
spritetype *pSprite = &actor->s();
|
||||
memset(pSprite, 0, sizeof(spritetype));
|
||||
InsertSpriteStat(nSprite, nStat);
|
||||
|
@ -196,7 +197,6 @@ int InsertSprite(int nSector, int nStat)
|
|||
actor->SetOwner(nullptr);
|
||||
pSprite->extra = -1;
|
||||
pSprite->index = nSprite;
|
||||
actor->xvel = actor->yvel = actor->zvel = 0;
|
||||
|
||||
Numsprites++;
|
||||
|
||||
|
@ -897,11 +897,11 @@ void dbLoadMap(const char *pPath, int *pX, int *pY, int *pZ, short *pAngle, shor
|
|||
pSprite->time = i;
|
||||
ValidateSprite(*pSprite);
|
||||
|
||||
InsertSpriteSect(i, sprite[i].sectnum);
|
||||
InsertSpriteStat(i, sprite[i].statnum);
|
||||
InsertSpriteSect(i, pSprite->sectnum);
|
||||
InsertSpriteStat(i, pSprite->statnum);
|
||||
Numsprites++;
|
||||
sprite[i].index = i;
|
||||
if (sprite[i].extra > 0)
|
||||
pSprite->index = i;
|
||||
if (pSprite->extra > 0)
|
||||
{
|
||||
char pBuffer[nXSpriteSize];
|
||||
int nXSprite = dbInsertXSprite(i);
|
||||
|
|
|
@ -6760,7 +6760,7 @@ void useSlopeChanger(DBloodActor* sourceactor, int objType, int objIndex, DBlood
|
|||
{
|
||||
auto spr = &iactor->s();
|
||||
auto xspr = &iactor->x();
|
||||
if (spr->extra > 0 && xspr->physAttr > 0)
|
||||
if (iactor->hasX() && xspr->physAttr > 0)
|
||||
{
|
||||
xspr->physAttr |= kPhysFalling;
|
||||
iactor->zvel++;
|
||||
|
|
|
@ -661,7 +661,7 @@ void playerStart(int nPlayer, int bNewLevel)
|
|||
|
||||
auto actor = actSpawnSprite(pStartZone->sectnum, pStartZone->x, pStartZone->y, pStartZone->z, 6, 1);
|
||||
spritetype* pSprite = &actor->s();
|
||||
assert(pSprite->extra > 0 && pSprite->extra < kMaxXSprites);
|
||||
assert(actor->hasX());
|
||||
XSPRITE *pXSprite = &actor->x();
|
||||
pPlayer->pSprite = pSprite;
|
||||
pPlayer->pXSprite = pXSprite;
|
||||
|
@ -901,7 +901,7 @@ char PickupItem(PLAYER *pPlayer, DBloodActor* itemactor)
|
|||
#endif
|
||||
case kItemFlagABase:
|
||||
case kItemFlagBBase: {
|
||||
if (gGameOptions.nGameType != 3 || pItem->extra <= 0) return 0;
|
||||
if (gGameOptions.nGameType != 3 || !itemactor->hasX()) return 0;
|
||||
XSPRITE * pXItem = &itemactor->x();
|
||||
if (pItem->type == kItemFlagABase) {
|
||||
if (pPlayer->teamId == 1) {
|
||||
|
@ -1105,7 +1105,7 @@ char PickupAmmo(PLAYER* pPlayer, DBloodActor* ammoactor)
|
|||
|
||||
if (pPlayer->ammoCount[nAmmoType] >= gAmmoInfo[nAmmoType].max) return 0;
|
||||
#ifdef NOONE_EXTENSIONS
|
||||
else if (gModernMap && pAmmo->extra >= 0 && ammoactor->x().data1 > 0) // allow custom amount for item
|
||||
else if (gModernMap && ammoactor->hasX() && ammoactor->x().data1 > 0) // allow custom amount for item
|
||||
pPlayer->ammoCount[nAmmoType] = ClipHigh(pPlayer->ammoCount[nAmmoType] + ammoactor->x().data1, gAmmoInfo[nAmmoType].max);
|
||||
#endif
|
||||
else
|
||||
|
@ -1941,7 +1941,6 @@ int playerDamageSprite(DBloodActor* source, PLAYER *pPlayer, DAMAGE_TYPE nDamage
|
|||
spritetype *pSprite = pPlayer->pSprite;
|
||||
XSPRITE *pXSprite = pPlayer->pXSprite;
|
||||
auto pActor = pPlayer->actor;
|
||||
int nXSprite = pSprite->extra;
|
||||
int nXSector = sector[pSprite->sectnum].extra;
|
||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||
int nDeathSeqID = -1;
|
||||
|
|
|
@ -601,8 +601,6 @@ void fakeActProcessSprites(void)
|
|||
spritetype *pSprite = gMe->pSprite;
|
||||
if (pSprite->statnum == kStatDude)
|
||||
{
|
||||
int nXSprite = pSprite->extra;
|
||||
assert(nXSprite > 0 && nXSprite < kMaxXSprites);
|
||||
int nSector = predict.sectnum;
|
||||
int nXSector = sector[nSector].extra;
|
||||
XSECTOR *pXSector = NULL;
|
||||
|
|
|
@ -226,7 +226,7 @@ void LifeLeechOperate(DBloodActor* actor, EVENT event)
|
|||
if (!pXSprite->stateTimer)
|
||||
{
|
||||
spritetype *pTarget = &target->s();
|
||||
if (pTarget->statnum == kStatDude && !(pTarget->flags&32) && pTarget->extra > 0 && pTarget->extra < kMaxXSprites)
|
||||
if (pTarget->statnum == kStatDude && !(pTarget->flags&32) && target->hasX())
|
||||
{
|
||||
int top, bottom;
|
||||
GetSpriteExtents(pSprite, &top, &bottom);
|
||||
|
@ -1140,7 +1140,7 @@ int VDoorBusy(unsigned int nSector, unsigned int a2)
|
|||
if (actor && a2 > pXSector->busy)
|
||||
{
|
||||
spritetype *pSprite = &actor->s();
|
||||
assert(pSprite->extra > 0 && pSprite->extra < kMaxXSprites);
|
||||
assert(actor->hasX());
|
||||
XSPRITE *pXSprite = &actor->x();
|
||||
if (pXSector->onCeilZ > pXSector->offCeilZ || pXSector->onFloorZ < pXSector->offFloorZ)
|
||||
{
|
||||
|
@ -1174,7 +1174,7 @@ int VDoorBusy(unsigned int nSector, unsigned int a2)
|
|||
else if (actor && a2 < pXSector->busy)
|
||||
{
|
||||
spritetype* pSprite = &actor->s();
|
||||
assert(pSprite->extra > 0 && pSprite->extra < kMaxXSprites);
|
||||
assert(actor->hasX());
|
||||
XSPRITE* pXSprite = &actor->x();
|
||||
if (pXSector->offCeilZ > pXSector->onCeilZ || pXSector->offFloorZ < pXSector->onFloorZ)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue