- wrapped user.zclip reads.

This commit is contained in:
Christoph Oelckers 2022-08-20 23:47:24 +02:00
parent 4021d13e8d
commit a630f27a48
6 changed files with 17 additions and 16 deletions

View file

@ -410,8 +410,8 @@ void EnemyDefaults(DSWActor* actor, ACTOR_ACTION_SET* action, PERSONALITY* perso
actor->user.zclip = Z(48);
actor->user.lo_step = Z(32);
actor->user.floor_dist = (actor->user.zclip - actor->user.lo_step) * zinttoworld;
actor->user.ceiling_dist = (ActorSizeZ(actor) - actor->user.zclip) * zinttoworld;
actor->user.floor_dist = (actor->user.int_zclip() - actor->user.lo_step) * zinttoworld;
actor->user.ceiling_dist = (ActorSizeZ(actor) - actor->user.int_zclip()) * zinttoworld;
actor->user.Radius = 400;

View file

@ -936,6 +936,7 @@ struct USER
int int_z_tgt() const { return z_tgt * zworldtoint; }
int int_ceiling_dist() const { return ceiling_dist * zworldtoint; }
int int_floor_dist() const { return floor_dist * zworldtoint; }
int int_zclip() const { return zclip/* * zworldtoint*/; }
//
// Variables that can be used by actors and Player
@ -967,6 +968,7 @@ struct USER
TObjPtr<DSWActor*> flagOwnerActor;
TObjPtr<DSWActor*> WpnGoalActor;
double hiz, loz;
double oz; // serialized copy of sprite.oz
double z_tgt;
double ceiling_dist;
@ -993,7 +995,6 @@ struct USER
// clipmove
int16_t lo_step;
double hiz, loz;
int zclip; // z height to move up for clipmove
int active_range;
sectortype* hi_sectp, *lo_sectp;

View file

@ -490,7 +490,7 @@ int DoHornetDeath(DSWActor* actor)
if (actor->user.Flags & (SPR_FALLING))
{
actor->user.loz = actor->user.zclip * zinttoworld;
actor->user.loz = actor->user.int_zclip() * zinttoworld;
DoFall(actor);
}
else

View file

@ -737,8 +737,8 @@ int SetupSerp(DSWActor* actor)
// size of step can walk off of
actor->user.lo_step = Z(40);
actor->user.floor_dist = (actor->user.zclip - actor->user.lo_step) * zinttoworld;
actor->user.ceiling_dist = (ActorSizeZ(actor) - actor->user.zclip) * zinttoworld;
actor->user.floor_dist = (actor->user.int_zclip() - actor->user.lo_step) * zinttoworld;
actor->user.ceiling_dist = (ActorSizeZ(actor) - actor->user.int_zclip()) * zinttoworld;
return 0;
}

View file

@ -232,16 +232,16 @@ void SpikeAlign(DSWActor* actor)
if ((int8_t)SP_TAG7(actor) < 0)
{
if (actor->spr.cstat & (CSTAT_SPRITE_YFLIP))
alignceilslope(actor->sector(), actor->int_pos().X, actor->int_pos().Y, actor->user.zclip);
alignceilslope(actor->sector(), actor->int_pos().X, actor->int_pos().Y, actor->user.int_zclip());
else
alignflorslope(actor->sector(), actor->int_pos().X, actor->int_pos().Y, actor->user.zclip);
alignflorslope(actor->sector(), actor->int_pos().X, actor->int_pos().Y, actor->user.int_zclip());
}
else
{
if (actor->spr.cstat & (CSTAT_SPRITE_YFLIP))
SOBJ_AlignCeilingToPoint(&SectorObject[SP_TAG7(actor)], actor->int_pos().X, actor->int_pos().Y, actor->user.zclip);
SOBJ_AlignCeilingToPoint(&SectorObject[SP_TAG7(actor)], actor->int_pos().X, actor->int_pos().Y, actor->user.int_zclip());
else
SOBJ_AlignFloorToPoint(&SectorObject[SP_TAG7(actor)], actor->int_pos().X, actor->int_pos().Y, actor->user.zclip);
SOBJ_AlignFloorToPoint(&SectorObject[SP_TAG7(actor)], actor->int_pos().X, actor->int_pos().Y, actor->user.int_zclip());
}
}

View file

@ -2250,7 +2250,7 @@ void SpriteSetup(void)
actor->user.zclip = florz;
// start off
actor->user.pos.Z = actor->user.zclip;
actor->user.pos.Z = actor->user.int_zclip();
actor->user.z_tgt = actor->spr.pos.Z;
if (start_on)
{
@ -2261,7 +2261,7 @@ void SpriteSetup(void)
}
// set orig z
actor->user.oz = actor->user.zclip * zinttoworld;
actor->user.oz = actor->user.int_zclip() * zinttoworld;
actor->opos.Z = actor->user.oz;
}
else
@ -2269,7 +2269,7 @@ void SpriteSetup(void)
actor->user.zclip = ceilz;
// start off
actor->user.pos.Z = actor->user.zclip;
actor->user.pos.Z = actor->user.int_zclip();
actor->user.z_tgt = actor->spr.pos.Z;
if (start_on)
{
@ -2280,7 +2280,7 @@ void SpriteSetup(void)
}
// set orig z
actor->user.oz = actor->user.zclip * zinttoworld;
actor->user.oz = actor->user.int_zclip() * zinttoworld;
actor->opos.Z = actor->user.oz;
}
@ -6232,7 +6232,7 @@ Collision move_sprite(DSWActor* actor, int xchange, int ychange, int zchange, in
else
{
// move the center point up for moving
zh = actor->user.zclip;
zh = actor->user.int_zclip();
clippos.Z -= zh;
}
@ -6426,7 +6426,7 @@ Collision move_missile(DSWActor* actor, int xchange, int ychange, int zchange, i
}
else
{
zh = actor->user.zclip;
zh = actor->user.int_zclip();
clippos.Z -= zh;
}