- several 'sectnum's.

This commit is contained in:
Christoph Oelckers 2021-11-24 01:59:55 +01:00
parent 9388f839b6
commit 879407538e
5 changed files with 10 additions and 10 deletions

View file

@ -5992,7 +5992,7 @@ static void actCheckExplosion()
if (gPhysSpritesList[i] == nullptr) continue;
auto physactor = gPhysSpritesList[i];
spritetype* pDebris = &physactor->s();
if (pDebris->sectnum < 0 || (pDebris->flags & kHitagFree) != 0) continue;
if (!pDebris->insector() || (pDebris->flags & kHitagFree) != 0) continue;
if (!CheckSector(sectorMap, pDebris) || !CheckProximity(physactor, x, y, z, pSector, radius)) continue;
else debrisConcuss(Owner, i, x, y, z, pExplodeInfo->dmgType);

View file

@ -605,7 +605,7 @@ void sub_76A08(DBloodActor *actor, spritetype *pSprite2, PLAYER *pPlayer) // ???
pSprite->y = pSprite2->y;
pSprite->z = pSprite2->sector()->floorz-(bottom-pSprite->z);
pSprite->ang = pSprite2->ang;
ChangeActorSect(actor, pSprite2->sectnum);
ChangeActorSect(actor, pSprite2->sector());
sfxPlay3DSound(pSprite2, 201, -1, 0);
actor->xvel = actor->yvel = actor->zvel = 0;
viewBackupSpriteLoc(actor);

View file

@ -256,7 +256,7 @@ void CFX::fxProcess(void)
void fxSpawnBlood(DBloodActor *actor, int )
{
spritetype* pSprite = &actor->s();
if (pSprite->sectnum < 0 || pSprite->sectnum >= numsectors)
if (!pSprite->insector())
return;
auto pSector = pSprite->sector();
if (!FindSector(pSprite->x, pSprite->y, pSprite->z, &pSector))
@ -277,7 +277,7 @@ void fxSpawnBlood(DBloodActor *actor, int )
void fxSpawnPodStuff(DBloodActor* actor, int )
{
auto pSprite = &actor->s();
if (pSprite->sectnum < 0 || pSprite->sectnum >= numsectors)
if (!pSprite->insector())
return;
auto pSector = pSprite->sector();
if (!FindSector(pSprite->x, pSprite->y, pSprite->z, &pSector))

View file

@ -343,7 +343,6 @@ int HitScan(DBloodActor *actor, int z, int dx, int dy, int dz, unsigned int nMas
gHitInfo.clearObj();
int x = pSprite->x;
int y = pSprite->y;
int nSector = pSprite->sectnum;
int bakCstat = pSprite->cstat;
pSprite->cstat &= ~256;
if (nRange)
@ -358,6 +357,7 @@ int HitScan(DBloodActor *actor, int z, int dx, int dy, int dz, unsigned int nMas
vec3_t pos = { x, y, z };
hitdata_t hitData;
hitData.pos.z = gHitInfo.hitz;
int nSector = pSprite->sectnum;
hitscan(&pos, nSector, dx, dy, dz << 4, &hitData, nMask);
gHitInfo.set(&hitData);
hitscangoal.x = hitscangoal.y = 0x1ffffff;
@ -394,7 +394,6 @@ int VectorScan(DBloodActor *actor, int nOffset, int nZOffset, int dx, int dy, in
int z1 = pSprite->z+nZOffset;
int bakCstat = pSprite->cstat;
pSprite->cstat &= ~256;
int nSector = pSprite->sectnum;
if (nRange)
{
hitscangoal.x = x1+MulScale(nRange<<4, Cos(pSprite->ang), 30);
@ -407,6 +406,7 @@ int VectorScan(DBloodActor *actor, int nOffset, int nZOffset, int dx, int dy, in
vec3_t pos = { x1, y1, z1 };
hitdata_t hitData;
hitData.pos.z = gHitInfo.hitz;
int nSector = pSprite->sectnum;
hitscan(&pos, nSector, dx, dy, dz << 4, &hitData, CLIPMASK1);
gHitInfo.set(&hitData);
hitscangoal.x = hitscangoal.y = 0x1ffffff;

View file

@ -1204,7 +1204,7 @@ void CheckPickUp(PLAYER *pPlayer)
int x = pSprite->x;
int y = pSprite->y;
int z = pSprite->z;
int nSector = pSprite->sectnum;
auto pSector = pSprite->sector();
BloodStatIterator it(kStatItem);
while (auto itemactor = it.Next())
{
@ -1229,9 +1229,9 @@ void CheckPickUp(PLAYER *pPlayer)
if (approxDist(dx,dy) > 48)
continue;
GetSpriteExtents(pItem, &top, &bottom);
if (cansee(x, y, z, nSector, pItem->x, pItem->y, pItem->z, pItem->sectnum)
|| cansee(x, y, z, nSector, pItem->x, pItem->y, top, pItem->sectnum)
|| cansee(x, y, z, nSector, pItem->x, pItem->y, bottom, pItem->sectnum))
if (cansee(x, y, z, pSector, pItem->x, pItem->y, pItem->z, pItem->sector())
|| cansee(x, y, z, pSector, pItem->x, pItem->y, top, pItem->sector())
|| cansee(x, y, z, pSector, pItem->x, pItem->y, bottom, pItem->sector()))
PickUp(pPlayer, itemactor);
}
}