- smaller stuff

This commit is contained in:
Christoph Oelckers 2021-11-24 01:11:49 +01:00
parent 4438c20cb4
commit 36d66f14b5
3 changed files with 18 additions and 18 deletions

View file

@ -588,15 +588,15 @@ void GetZRange(DBloodActor *actor, int *ceilZ, Collision *ceilColl, int *floorZ,
floorColl->setFromEngine(floorHit);
if (floorColl->type == kHitSector)
{
int nSector = floorColl->index;
if ((nClipParallax & PARALLAXCLIP_FLOOR) == 0 && (sector[nSector].floorstat & 1))
auto pSector = floorColl->sector();
if ((nClipParallax & PARALLAXCLIP_FLOOR) == 0 && (pSector->floorstat & 1))
*floorZ = 0x7fffffff;
if (sector[nSector].hasX())
if (pSector->hasX())
{
XSECTOR *pXSector = &sector[nSector].xs();
XSECTOR *pXSector = &pSector->xs();
*floorZ += pXSector->Depth << 10;
}
auto actor = getUpperLink(nSector);
auto actor = pSector->upperLink;
if (actor)
{
auto link = actor->GetOwner();
@ -608,10 +608,10 @@ void GetZRange(DBloodActor *actor, int *ceilZ, Collision *ceilColl, int *floorZ,
}
if (ceilColl->type == kHitSector)
{
int nSector = ceilColl->index;
if ((nClipParallax & PARALLAXCLIP_CEILING) == 0 && (sector[nSector].ceilingstat & 1))
auto pSector = ceilColl->sector();
if ((nClipParallax & PARALLAXCLIP_CEILING) == 0 && (pSector->ceilingstat & 1))
*ceilZ = 0x80000000;
auto actor = getLowerLink(nSector);
auto actor = pSector->lowerLink;
if (actor)
{
auto link = actor->GetOwner();

View file

@ -110,7 +110,8 @@ void InitMirrors(void)
if (mirrorcnt >= 15)
break;
if (sector[i].floorpicnum == 504)
auto secti = &sector[i];
if (secti->floorpicnum == 504)
{
auto link = getUpperLink(i);
if (link == nullptr)
@ -119,7 +120,6 @@ void InitMirrors(void)
if (link2 == nullptr)
continue;
auto secti = &sector[i];
int j = link2->s().sectnum;
auto sectj = link2->s().sector();
if (sectj->ceilingpicnum != 504)

View file

@ -1318,7 +1318,7 @@ void nnExtProcessSuperSprites()
continue;
}
XSECTOR* pXSector = (sector[pDebris->sectnum].hasX()) ? &sector[pDebris->sectnum].xs() : nullptr;
XSECTOR* pXSector = (pDebris->sector()->hasX()) ? &pDebris->sector()->xs() : nullptr;
viewBackupSpriteLoc(debrisactor);
bool uwater = false;
@ -1340,8 +1340,8 @@ void nnExtProcessSuperSprites()
if (!pXSector->panAlways && pXSector->busy)
speed = MulScale(speed, pXSector->busy, 16);
}
if (sector[pDebris->sectnum].floorstat & 64)
angle = (angle + GetWallAngle(sector[pDebris->sectnum].firstWall()) + 512) & 2047;
if (pDebris->sector()->floorstat & 64)
angle = (angle + GetWallAngle(pDebris->sector()->firstWall()) + 512) & 2047;
int dx = MulScale(speed, Cos(angle), 30);
int dy = MulScale(speed, Sin(angle), 30);
debrisactor->xvel += dx;
@ -1395,13 +1395,13 @@ void nnExtProcessSuperSprites()
if (ang < pXDebris->goalAng) pDebris->ang = ClipHigh(ang + angStep, pXDebris->goalAng);
else if (ang > pXDebris->goalAng) pDebris->ang = ClipLow(ang - angStep, pXDebris->goalAng);
int nSector = pDebris->sectnum;
int cz = getceilzofslope(nSector, pDebris->x, pDebris->y);
int fz = getflorzofslope(nSector, pDebris->x, pDebris->y);
auto pSector = pDebris->sector();
int cz = getceilzofslopeptr(pSector, pDebris->x, pDebris->y);
int fz = getflorzofslopeptr(pSector, pDebris->x, pDebris->y);
GetActorExtents(debrisactor, &top, &bottom);
if (fz >= bottom && getLowerLink(nSector) == nullptr && !(sector[nSector].ceilingstat & 0x1)) pDebris->z += ClipLow(cz - top, 0);
if (cz <= top && getUpperLink(nSector) == nullptr && !(sector[nSector].floorstat & 0x1)) pDebris->z += ClipHigh(fz - bottom, 0);
if (fz >= bottom && pSector->lowerLink == nullptr && !(pSector->ceilingstat & 0x1)) pDebris->z += ClipLow(cz - top, 0);
if (cz <= top && pSector->upperLink == nullptr && !(pSector->floorstat & 0x1)) pDebris->z += ClipHigh(fz - bottom, 0);
}
}
}