mirror of
https://github.com/DrBeef/Raze.git
synced 2025-02-21 19:21:44 +00:00
- handle most set_int_z calls in Exhumed
This commit is contained in:
parent
ae79f3e3c3
commit
3a77742b72
9 changed files with 24 additions and 26 deletions
|
@ -416,7 +416,7 @@ void AIAnubis::Damage(RunListEvent* ev)
|
|||
ap->spr.xvel = 0;
|
||||
ap->spr.yvel = 0;
|
||||
ap->spr.zvel = 0;
|
||||
ap->set_int_z(ap->sector()->int_floorz());
|
||||
ap->spr.pos.Z = ap->sector()->floorz;
|
||||
ap->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL;
|
||||
|
||||
ap->nHealth = 0;
|
||||
|
|
|
@ -685,11 +685,11 @@ DExhumedActor* BuildBullet(DExhumedActor* pActor, int nType, int nZOffset, int n
|
|||
|
||||
pSector = pBulletActor->sector();
|
||||
|
||||
while (pBulletActor->int_pos().Z < pSector->int_ceilingz())
|
||||
while (pBulletActor->spr.pos.Z < pSector->ceilingz)
|
||||
{
|
||||
if (pSector->pAbove == nullptr)
|
||||
{
|
||||
pBulletActor->set_int_z(pSector->int_ceilingz());
|
||||
pBulletActor->spr.pos.Z = pSector->ceilingz;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -1408,7 +1408,7 @@ void AICreatureChunk::Tick(RunListEvent* ev)
|
|||
pActor->spr.xvel = 0;
|
||||
pActor->spr.yvel = 0;
|
||||
pActor->spr.zvel = 0;
|
||||
pActor->set_int_z(pSector->int_floorz());
|
||||
pActor->spr.pos.Z = pSector->floorz;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -444,7 +444,7 @@ void AIMummy::Damage(RunListEvent* ev)
|
|||
pActor->spr.xvel = 0;
|
||||
pActor->spr.yvel = 0;
|
||||
pActor->spr.zvel = 0;
|
||||
pActor->set_int_z(pActor->sector()->int_floorz());
|
||||
pActor->spr.pos.Z = pActor->sector()->floorz;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -630,19 +630,19 @@ int CheckSectorSprites(sectortype* pSector, int nVal)
|
|||
}
|
||||
|
||||
// done
|
||||
void MoveSectorSprites(sectortype* pSector, int z)
|
||||
void MoveSectorSprites(sectortype* pSector, double z)
|
||||
{
|
||||
int newz = pSector->int_floorz();
|
||||
int oldz = newz - z;
|
||||
int minz = min(newz, oldz);
|
||||
int maxz = max(newz, oldz);
|
||||
double newz = pSector->floorz;
|
||||
double oldz = newz - z;
|
||||
double minz = min(newz, oldz);
|
||||
double maxz = max(newz, oldz);
|
||||
ExhumedSectIterator it(pSector);
|
||||
while (auto pActor = it.Next())
|
||||
{
|
||||
int actz = pActor->int_pos().Z;
|
||||
int actz = pActor->spr.pos.Z;
|
||||
if ((pActor->spr.statnum != 200 && actz >= minz && actz <= maxz) || pActor->spr.statnum >= 900)
|
||||
{
|
||||
pActor->set_int_z(newz);
|
||||
pActor->spr.pos.Z = newz;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -788,7 +788,7 @@ void AIElev::Tick(RunListEvent* ev)
|
|||
}
|
||||
else
|
||||
{
|
||||
MoveSectorSprites(pSector, nVal);
|
||||
MoveSectorSprites(pSector, nVal * inttoworld);
|
||||
|
||||
if (nVal < 0 && CheckSectorSprites(pSector, 2))
|
||||
{
|
||||
|
@ -1399,7 +1399,7 @@ DExhumedActor* BuildSpark(DExhumedActor* pActor, int nVal)
|
|||
pSpark->spr.picnum = kTile985 + nVal;
|
||||
}
|
||||
|
||||
pSpark->set_int_z(pActor->int_pos().Z);
|
||||
pSpark->spr.pos.Z = pActor->spr.pos.Z;
|
||||
pSpark->spr.lotag = runlist_HeadRun() + 1;
|
||||
pSpark->spr.clipdist = 1;
|
||||
pSpark->spr.hitag = 0;
|
||||
|
@ -1580,7 +1580,7 @@ DExhumedActor* BuildEnergyBlock(sectortype* pSector)
|
|||
|
||||
// GrabTimeSlot(3);
|
||||
|
||||
pActor->set_int_z(pSector->firstWall()->nextSector()->int_floorz());
|
||||
pActor->spr.pos.Z = pSector->firstWall()->nextSector()->floorz;
|
||||
|
||||
// CHECKME - name of this variable?
|
||||
int nRepeat = (pActor->int_pos().Z - pSector->int_floorz()) >> 8;
|
||||
|
@ -1660,7 +1660,7 @@ void ExplodeEnergyBlock(DExhumedActor* pActor)
|
|||
pSector->extra = -1;
|
||||
pSector->set_int_floorz(pActor->int_pos().Z);
|
||||
|
||||
pActor->set_int_z((pActor->int_pos().Z + pSector->int_floorz()) / 2);
|
||||
pActor->spr.pos.Z = (pActor->spr.pos.Z + pSector->floorz) * 0.5;
|
||||
|
||||
BuildSpark(pActor, 3);
|
||||
|
||||
|
@ -2119,11 +2119,9 @@ void DoDrips()
|
|||
}
|
||||
else
|
||||
{
|
||||
int nFloorZ = pSector->int_floorz();
|
||||
|
||||
double nFloorZ = pSector->floorz;
|
||||
pSector->set_int_floorz(edx + sBob[i].z);
|
||||
|
||||
MoveSectorSprites(pSector, pSector->int_floorz() - nFloorZ);
|
||||
MoveSectorSprites(pSector, pSector->floorz - nFloorZ);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -877,7 +877,7 @@ void AIPlayer::Tick(RunListEvent* ev)
|
|||
vec3_t pos = pPlayerActor->int_pos();
|
||||
SetActor(pPlayerActor, &pos);
|
||||
|
||||
pPlayerActor->set_int_z(pPlayerActor->sector()->int_floorz());
|
||||
pPlayerActor->spr.pos.Z = pPlayerActor->sector()->floorz;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1257,7 +1257,7 @@ sectdone:
|
|||
ChangeActorSect(pFloorActor, pPlayerActor->sector());
|
||||
}
|
||||
|
||||
pFloorActor->set_int_z(pPlayerActor->sector()->int_floorz());
|
||||
pFloorActor->spr.pos.Z = pPlayerActor->sector()->floorz;
|
||||
}
|
||||
|
||||
int var_30 = 0;
|
||||
|
@ -2444,7 +2444,7 @@ sectdone:
|
|||
{
|
||||
pPlayerActor->spr.picnum = seq_GetSeqPicnum(kSeqJoe, 120, 0);
|
||||
pPlayerActor->spr.cstat = 0;
|
||||
pPlayerActor->set_int_z(pPlayerActor->sector()->int_floorz());
|
||||
pPlayerActor->spr.pos.Z = pPlayerActor->sector()->floorz;
|
||||
}
|
||||
|
||||
// will invalidate nPlayerSprite
|
||||
|
|
|
@ -640,7 +640,7 @@ void AIQueenEgg::Tick(RunListEvent* ev)
|
|||
if (pEgg->nCounter <= 0)
|
||||
{
|
||||
auto pWaspSprite = BuildWasp(nullptr, pActor->spr.pos, pActor->sector(), pActor->int_ang(), true);
|
||||
pActor->set_int_z(pWaspSprite->int_pos().Z);
|
||||
pActor->spr.pos.Z = pWaspSprite->spr.pos.Z;
|
||||
|
||||
DestroyEgg(nEgg);
|
||||
}
|
||||
|
|
|
@ -632,7 +632,7 @@ int seq_PlotSequence(int nSprite, int16_t edx, int16_t nFrame, int16_t ecx)
|
|||
}
|
||||
|
||||
pTSprite->cstat = CSTAT_SPRITE_ALIGNMENT_FLOOR | CSTAT_SPRITE_TRANSLUCENT;
|
||||
pTSprite->set_int_z(nFloorZ);
|
||||
pTSprite->pos.Z = pSector->floorz;
|
||||
pTSprite->yrepeat = (uint8_t)edx;
|
||||
pTSprite->xrepeat = (uint8_t)edx;
|
||||
pTSprite->statnum = -3;
|
||||
|
|
|
@ -175,7 +175,7 @@ void AISpider::Tick(RunListEvent* ev)
|
|||
if (spp->spr.cstat & CSTAT_SPRITE_YFLIP)
|
||||
{
|
||||
spp->spr.zvel = 0;
|
||||
spp->set_int_z(pSector->int_ceilingz() + (tileHeight(spp->spr.picnum) << 5));
|
||||
spp->spr.pos.Z = pSector->ceilingz + (tileHeight(spp->spr.picnum) / 8.); // was << 5 in Build coordinates
|
||||
|
||||
if (pSector->ceilingstat & CSTAT_SECTOR_SKY)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue