- floatified sop->crush_z

This commit is contained in:
Christoph Oelckers 2022-09-05 17:35:08 +02:00
parent da8805ad69
commit addda94ee5
3 changed files with 8 additions and 17 deletions

View file

@ -1476,10 +1476,10 @@ struct SECTOR_OBJECT
drive_angslide,
drive_speed,
drive_slide,
crush_z,
flags;
double morph_z, // morphing point z
double crush_z,
morph_z, // morphing point z
morph_z_min, // morphing point z min
morph_z_max;

View file

@ -2523,7 +2523,7 @@ void DriveCrush(PLAYER* pp, DVector2* quad)
if (actor->spr.statnum > STAT_DONT_DRAW)
continue;
if (actor->int_pos().Z < sop->crush_z)
if (actor->spr.pos.Z < sop->crush_z)
continue;
SpriteQueueDelete(actor);
@ -2538,7 +2538,7 @@ void DriveCrush(PLAYER* pp, DVector2* quad)
if (testpointinquad(actor->spr.pos, quad))
{
//if (actor->spr.z < pp->posz)
if (actor->int_pos().Z < sop->crush_z)
if (actor->spr.pos.Z < sop->crush_z)
continue;
double const vel = pp->vect.Length() * 8;
@ -2564,7 +2564,7 @@ void DriveCrush(PLAYER* pp, DVector2* quad)
{
if (testpointinquad(actor->spr.pos, quad))
{
if (actor->int_pos().Z < sop->crush_z)
if (actor->spr.pos.Z < sop->crush_z)
continue;
SpriteQueueDelete(actor);
@ -2589,7 +2589,7 @@ void DriveCrush(PLAYER* pp, DVector2* quad)
int damage;
//if (actor->spr.z < pp->posz)
if (actor->int_pos().Z < sop->crush_z)
if (actor->spr.pos.Z < sop->crush_z)
continue;
damage = -(actor->user.Health + 100);
@ -2607,7 +2607,7 @@ void DriveCrush(PLAYER* pp, DVector2* quad)
while (auto actor = it.Next())
{
// give some extra buffer
if (actor->int_pos().Z < sop->crush_z + Z(40))
if (actor->spr.pos.Z < sop->crush_z + 40)
continue;
if ((actor->spr.extra & SPRX_PLAYER_OR_ENEMY))
@ -3746,15 +3746,6 @@ void DoPlayerBeginFly(PLAYER* pp)
NewStateGroup(pp->actor, sg_PlayerNinjaFly);
}
int GetSinNdx(int range, int bobamt)
{
int amt;
amt = Z(512) / range;
return bobamt * amt;
}
void PlayerWarpUpdatePos(PLAYER* pp)
{
if (Prediction)

View file

@ -1151,7 +1151,7 @@ void SetupSectorObject(sectortype* sectp, short tag)
if (TEST_BOOL4(actor))
{
sop->crush_z = actor->int_pos().Z;
sop->crush_z = actor->spr.pos.Z;
sop->flags |= (SOBJ_RECT_CLIP);
}