- fxProcess

This commit is contained in:
Christoph Oelckers 2021-11-24 01:08:46 +01:00
parent f52a542fad
commit 4438c20cb4
2 changed files with 10 additions and 10 deletions

View file

@ -603,7 +603,7 @@ void sub_76A08(DBloodActor *actor, spritetype *pSprite2, PLAYER *pPlayer) // ???
GetSpriteExtents(pSprite, &top, &bottom);
pSprite->x = pSprite2->x;
pSprite->y = pSprite2->y;
pSprite->z = sector[pSprite2->sectnum].floorz-(bottom-pSprite->z);
pSprite->z = pSprite2->sector()->floorz-(bottom-pSprite->z);
pSprite->ang = pSprite2->ang;
ChangeActorSect(actor, pSprite2->sectnum);
sfxPlay3DSound(pSprite2, 201, -1, 0);

View file

@ -196,8 +196,8 @@ void CFX::fxProcess(void)
{
spritetype *pSprite = &actor->s();
viewBackupSpriteLoc(actor);
int nSector = pSprite->sectnum;
assert(validSectorIndex(nSector));
auto pSector = pSprite->sector();
assert(pSector);
assert(pSprite->type < kFXMax);
FXDATA *pFXData = &gFXData[pSprite->type];
actAirDrag(actor, pFXData->drag);
@ -207,8 +207,8 @@ void CFX::fxProcess(void)
// Weird...
if (actor->xvel || (actor->yvel && pSprite->z >= pSprite->sector()->floorz))
{
updatesector(pSprite->x, pSprite->y, &nSector);
if (nSector == -1)
updatesector(pSprite->x, pSprite->y, &pSector);
if (pSector == nullptr)
{
remove(actor);
continue;
@ -223,17 +223,17 @@ void CFX::fxProcess(void)
gCallback[pFXData->funcID](actor, nullptr);
continue;
}
if (nSector != pSprite->sectnum)
if (pSector != pSprite->sector())
{
assert(validSectorIndex(nSector));
ChangeActorSect(actor, nSector);
assert(pSector);
ChangeActorSect(actor, pSector);
}
}
if (actor->xvel || actor->yvel || actor->zvel)
{
int32_t floorZ, ceilZ;
getzsofslope(nSector, pSprite->x, pSprite->y, &ceilZ, &floorZ);
if (ceilZ > pSprite->z && !(sector[nSector].ceilingstat&1))
getzsofslopeptr(pSector, pSprite->x, pSprite->y, &ceilZ, &floorZ);
if (ceilZ > pSprite->z && !(pSector->ceilingstat&1))
{
remove(actor);
continue;