- SW: Replace USER sz with pos.Z calls.

This commit is contained in:
Mitchell Richters 2021-12-30 17:06:49 +11:00
parent 0d70d26625
commit 9c1e54a148
13 changed files with 110 additions and 111 deletions

View file

@ -456,7 +456,7 @@ int DoFireFly(DSWActor* actor)
actor->user.WaitTics = (actor->user.WaitTics + (ACTORMOVETICS << 1)) & 2047;
actor->spr.pos.Z = actor->user.sz + MulScale(Z(32), bsin(actor->user.WaitTics), 14);
actor->spr.pos.Z = actor->user.pos.Z + MulScale(Z(32), bsin(actor->user.WaitTics), 14);
return 0;
}

View file

@ -505,7 +505,7 @@ void CoolgCommon(DSWActor* actor)
actor->user.floor_dist = Z(16);
actor->user.ceiling_dist = Z(20);
actor->user.sz = actor->spr.pos.Z;
actor->user.pos.Z = actor->spr.pos.Z;
actor->spr.xrepeat = 42;
actor->spr.yrepeat = 42;
@ -615,7 +615,7 @@ int DoCoolgMatchPlayerZ(DSWActor* actor)
// actor does a sine wave about sz - this is the z mid point
zdiff = (ActorZOfMiddle(actor->user.targetActor)) - actor->user.sz;
zdiff = (ActorZOfMiddle(actor->user.targetActor)) - actor->user.pos.Z;
// check z diff of the player and the sprite
zdist = Z(20 + RandomRange(100)); // put a random amount
@ -623,9 +623,9 @@ int DoCoolgMatchPlayerZ(DSWActor* actor)
if (labs(zdiff) > zdist)
{
if (zdiff > 0)
actor->user.sz += 170 * ACTORMOVETICS;
actor->user.pos.Z += 170 * ACTORMOVETICS;
else
actor->user.sz -= 170 * ACTORMOVETICS;
actor->user.pos.Z -= 170 * ACTORMOVETICS;
}
// save off lo and hi z
@ -642,9 +642,9 @@ int DoCoolgMatchPlayerZ(DSWActor* actor)
else
bound = loz - actor->user.floor_dist - COOLG_BOB_AMT;
if (actor->user.sz > bound)
if (actor->user.pos.Z > bound)
{
actor->user.sz = bound;
actor->user.pos.Z = bound;
}
// upper bound
@ -653,22 +653,22 @@ int DoCoolgMatchPlayerZ(DSWActor* actor)
else
bound = hiz + actor->user.ceiling_dist + COOLG_BOB_AMT;
if (actor->user.sz < bound)
if (actor->user.pos.Z < bound)
{
actor->user.sz = bound;
actor->user.pos.Z = bound;
}
actor->user.sz = min(actor->user.sz, loz - actor->user.floor_dist);
actor->user.sz = max(actor->user.sz, hiz + actor->user.ceiling_dist);
actor->user.pos.Z = min(actor->user.pos.Z, loz - actor->user.floor_dist);
actor->user.pos.Z = max(actor->user.pos.Z, hiz + actor->user.ceiling_dist);
actor->user.Counter = (actor->user.Counter + (ACTORMOVETICS<<3)) & 2047;
actor->spr.pos.Z = actor->user.sz + MulScale(COOLG_BOB_AMT, bsin(actor->user.Counter), 14);
actor->spr.pos.Z = actor->user.pos.Z + MulScale(COOLG_BOB_AMT, bsin(actor->user.Counter), 14);
bound = actor->user.hiz + actor->user.ceiling_dist + COOLG_BOB_AMT;
if (actor->spr.pos.Z < bound)
{
// bumped something
actor->spr.pos.Z = actor->user.sz = bound + COOLG_BOB_AMT;
actor->spr.pos.Z = actor->user.pos.Z = bound + COOLG_BOB_AMT;
}
return 0;
@ -693,7 +693,7 @@ int InitCoolgCircle(DSWActor* actor)
// z velocity
actor->user.jump_speed = 400 + RANDOM_P2(256);
if (labs(actor->user.sz - actor->user.hiz) < labs(actor->user.sz - actor->user.loz))
if (labs(actor->user.pos.Z - actor->user.hiz) < labs(actor->user.pos.Z - actor->user.loz))
actor->user.jump_speed = -actor->user.jump_speed;
actor->user.WaitTics = (RandomRange(3)+1) * 120;
@ -719,13 +719,13 @@ int DoCoolgCircle(DSWActor* actor)
}
// move in the z direction
actor->user.sz -= actor->user.jump_speed * ACTORMOVETICS;
actor->user.pos.Z -= actor->user.jump_speed * ACTORMOVETICS;
bound = actor->user.hiz + actor->user.ceiling_dist + COOLG_BOB_AMT;
if (actor->user.sz < bound)
if (actor->user.pos.Z < bound)
{
// bumped something
actor->user.sz = bound;
actor->user.pos.Z = bound;
InitActorReposition(actor);
return 0;
}

View file

@ -364,7 +364,7 @@ void EelCommon(DSWActor* actor)
actor->user.floor_dist = Z(16);
actor->user.ceiling_dist = Z(20);
actor->user.sz = actor->spr.pos.Z;
actor->user.pos.Z = actor->spr.pos.Z;
actor->spr.xrepeat = 35;
actor->spr.yrepeat = 27;
@ -436,7 +436,7 @@ int DoEelMatchPlayerZ(DSWActor* actor)
// actor does a sine wave about actor->user.sz - this is the z mid point
zdiff = (ActorZOfBottom(actor->user.targetActor) - Z(8)) - actor->user.sz;
zdiff = (ActorZOfBottom(actor->user.targetActor) - Z(8)) - actor->user.pos.Z;
// check z diff of the player and the sprite
zdist = Z(20 + RandomRange(64)); // put a random amount
@ -444,9 +444,9 @@ int DoEelMatchPlayerZ(DSWActor* actor)
{
if (zdiff > 0)
// manipulate the z midpoint
actor->user.sz += 160 * ACTORMOVETICS;
actor->user.pos.Z += 160 * ACTORMOVETICS;
else
actor->user.sz -= 160 * ACTORMOVETICS;
actor->user.pos.Z -= 160 * ACTORMOVETICS;
}
const int EEL_BOB_AMT = (Z(4));
@ -464,16 +464,16 @@ int DoEelMatchPlayerZ(DSWActor* actor)
{
DISTANCE(actor->spr.pos.X, actor->spr.pos.Y, actor->user.lowActor->spr.pos.X, actor->user.lowActor->spr.pos.Y, dist, a, b, c);
if (dist <= 300)
bound = actor->user.sz;
bound = actor->user.pos.Z;
else
bound = loz - actor->user.floor_dist;
}
else
bound = loz - actor->user.floor_dist - EEL_BOB_AMT;
if (actor->user.sz > bound)
if (actor->user.pos.Z > bound)
{
actor->user.sz = bound;
actor->user.pos.Z = bound;
}
// upper bound
@ -481,29 +481,29 @@ int DoEelMatchPlayerZ(DSWActor* actor)
{
DISTANCE(actor->spr.pos.X, actor->spr.pos.Y, actor->user.highActor->spr.pos.X, actor->user.highActor->spr.pos.Y, dist, a, b, c);
if (dist <= 300)
bound = actor->user.sz;
bound = actor->user.pos.Z;
else
bound = hiz + actor->user.ceiling_dist;
}
else
bound = hiz + actor->user.ceiling_dist + EEL_BOB_AMT;
if (actor->user.sz < bound)
if (actor->user.pos.Z < bound)
{
actor->user.sz = bound;
actor->user.pos.Z = bound;
}
actor->user.sz = min(actor->user.sz, loz - actor->user.floor_dist);
actor->user.sz = max(actor->user.sz, hiz + actor->user.ceiling_dist);
actor->user.pos.Z = min(actor->user.pos.Z, loz - actor->user.floor_dist);
actor->user.pos.Z = max(actor->user.pos.Z, hiz + actor->user.ceiling_dist);
actor->user.Counter = (actor->user.Counter + (ACTORMOVETICS << 3) + (ACTORMOVETICS << 1)) & 2047;
actor->spr.pos.Z = actor->user.sz + MulScale(EEL_BOB_AMT, bsin(actor->user.Counter), 14);
actor->spr.pos.Z = actor->user.pos.Z + MulScale(EEL_BOB_AMT, bsin(actor->user.Counter), 14);
bound = actor->user.hiz + actor->user.ceiling_dist + EEL_BOB_AMT;
if (actor->spr.pos.Z < bound)
{
// bumped something
actor->spr.pos.Z = actor->user.sz = bound + EEL_BOB_AMT;
actor->spr.pos.Z = actor->user.pos.Z = bound + EEL_BOB_AMT;
}
return 0;

View file

@ -1057,7 +1057,6 @@ struct USER
int16_t wait_active_check; // for enemy checking of player
int16_t inactive_time; // length of time actor has been unaware of his tgt
vec3_t pos;
int sz;
int16_t sang;
uint8_t spal; // save off default palette number
@ -2188,7 +2187,7 @@ struct ANIMstruct
return animactor->spr.pos.Z;
case ANIM_Userz:
if (animactor == nullptr) return scratch;
return animactor->user.sz;
return animactor->user.pos.Z;
case ANIM_SUdepth:
return sector[animindex].depth_fixed;
default:

View file

@ -312,7 +312,7 @@ int SetupHornet(DSWActor* actor)
actor->user.floor_dist = Z(16);
actor->user.ceiling_dist = Z(16);
actor->user.sz = actor->spr.pos.Z;
actor->user.pos.Z = actor->spr.pos.Z;
actor->spr.xrepeat = 37;
actor->spr.yrepeat = 32;
@ -345,7 +345,7 @@ int DoHornetMatchPlayerZ(DSWActor* actor)
// actor does a sine wave about actor->user.sz - this is the z mid point
zdiff = (ActorZOfMiddle(actor->user.targetActor)) - actor->user.sz;
zdiff = (ActorZOfMiddle(actor->user.targetActor)) - actor->user.pos.Z;
// check z diff of the player and the sprite
zdist = Z(20 + RandomRange(200)); // put a random amount
@ -354,9 +354,9 @@ int DoHornetMatchPlayerZ(DSWActor* actor)
if (zdiff > 0)
// manipulate the z midpoint
//actor->user.sz += 256 * ACTORMOVETICS;
actor->user.sz += 1024 * ACTORMOVETICS;
actor->user.pos.Z += 1024 * ACTORMOVETICS;
else
actor->user.sz -= 256 * ACTORMOVETICS;
actor->user.pos.Z -= 256 * ACTORMOVETICS;
}
// save off lo and hi z
@ -373,9 +373,9 @@ int DoHornetMatchPlayerZ(DSWActor* actor)
else
bound = loz - actor->user.floor_dist - HORNET_BOB_AMT;
if (actor->user.sz > bound)
if (actor->user.pos.Z > bound)
{
actor->user.sz = bound;
actor->user.pos.Z = bound;
}
// upper bound
@ -384,22 +384,22 @@ int DoHornetMatchPlayerZ(DSWActor* actor)
else
bound = hiz + actor->user.ceiling_dist + HORNET_BOB_AMT;
if (actor->user.sz < bound)
if (actor->user.pos.Z < bound)
{
actor->user.sz = bound;
actor->user.pos.Z = bound;
}
actor->user.sz = min(actor->user.sz, loz - actor->user.floor_dist);
actor->user.sz = max(actor->user.sz, hiz + actor->user.ceiling_dist);
actor->user.pos.Z = min(actor->user.pos.Z, loz - actor->user.floor_dist);
actor->user.pos.Z = max(actor->user.pos.Z, hiz + actor->user.ceiling_dist);
actor->user.Counter = (actor->user.Counter + (ACTORMOVETICS << 3) + (ACTORMOVETICS << 1)) & 2047;
actor->spr.pos.Z = actor->user.sz + MulScale(HORNET_BOB_AMT, bsin(actor->user.Counter), 14);
actor->spr.pos.Z = actor->user.pos.Z + MulScale(HORNET_BOB_AMT, bsin(actor->user.Counter), 14);
bound = actor->user.hiz + actor->user.ceiling_dist + HORNET_BOB_AMT;
if (actor->spr.pos.Z < bound)
{
// bumped something
actor->spr.pos.Z = actor->user.sz = bound + HORNET_BOB_AMT;
actor->spr.pos.Z = actor->user.pos.Z = bound + HORNET_BOB_AMT;
}
return 0;
@ -424,7 +424,7 @@ int InitHornetCircle(DSWActor* actor)
// z velocity
actor->user.jump_speed = 200 + RANDOM_P2(128);
if (labs(actor->user.sz - actor->user.hiz) < labs(actor->user.sz - actor->user.loz))
if (labs(actor->user.pos.Z - actor->user.hiz) < labs(actor->user.pos.Z - actor->user.loz))
actor->user.jump_speed = -actor->user.jump_speed;
actor->user.WaitTics = (RandomRange(3)+1) * 60;
@ -461,13 +461,13 @@ int DoHornetCircle(DSWActor* actor)
}
// move in the z direction
actor->user.sz -= actor->user.jump_speed * ACTORMOVETICS;
actor->user.pos.Z -= actor->user.jump_speed * ACTORMOVETICS;
bound = actor->user.hiz + actor->user.ceiling_dist + HORNET_BOB_AMT;
if (actor->user.sz < bound)
if (actor->user.pos.Z < bound)
{
// bumped something
actor->user.sz = bound;
actor->user.pos.Z = bound;
InitActorReposition(actor);
return 0;
}

View file

@ -259,10 +259,10 @@ STATE s_BloodSprayDrip[] =
int DoWallBloodDrip(DSWActor* actor)
{
// sy & sz are the ceiling and floor of the sector you are sliding down
if (actor->user.sz != actor->user.pos.Y)
if (actor->user.pos.Z != actor->user.pos.Y)
{
// if you are between the ceiling and floor fall fast
if (actor->spr.pos.Z > actor->user.pos.Y && actor->spr.pos.Z < actor->user.sz)
if (actor->spr.pos.Z > actor->user.pos.Y && actor->spr.pos.Z < actor->user.pos.Z)
{
actor->spr.zvel += 300;
actor->spr.pos.Z += actor->spr.zvel;
@ -454,9 +454,9 @@ int DoBloodSpray(DSWActor* actor)
{
// sy & sz are the ceiling and floor of the sector you are sliding down
if (bldActor->tempwall->twoSided())
getzsofslopeptr(bldActor->tempwall->nextSector(), actor->spr.pos.X, actor->spr.pos.Y, &actor->user.pos.Y, &actor->user.sz);
getzsofslopeptr(bldActor->tempwall->nextSector(), actor->spr.pos.X, actor->spr.pos.Y, &actor->user.pos.Y, &actor->user.pos.Z);
else
actor->user.pos.Y = actor->user.sz; // ceiling and floor are equal - white wall
actor->user.pos.Y = actor->user.pos.Z; // ceiling and floor are equal - white wall
}
actor->spr.cstat &= ~(CSTAT_SPRITE_INVISIBLE);
@ -2147,7 +2147,7 @@ int DoFlag(DSWActor* actor)
// attach weapon to sprite
actor->spr.cstat &= ~(CSTAT_SPRITE_BLOCK | CSTAT_SPRITE_BLOCK_HITSCAN);
SetAttach(hitActor, actor);
actor->user.sz = hitActor->spr.pos.Z - (ActorSizeZ(hitActor) >> 1);
actor->user.pos.Z = hitActor->spr.pos.Z - (ActorSizeZ(hitActor) >> 1);
}
}

View file

@ -840,7 +840,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, USER& w, USER* def
("inactive_time", w.inactive_time, def->inactive_time)
("sx", w.pos.X, def->pos.X)
("sy", w.pos.Y, def->pos.Y)
("sz", w.sz, def->sz)
("sz", w.pos.Z, def->pos.Z)
("sang", w.sang, def->sang)
("spal", w.spal, def->spal)
//("ret", w.coll, def->coll) // is this needed?

View file

@ -243,7 +243,7 @@ int SetupSkull(DSWActor* actor)
else
{
actor->user.Counter = RANDOM_P2(2048);
actor->user.sz = actor->spr.pos.Z;
actor->user.pos.Z = actor->spr.pos.Z;
}
@ -407,7 +407,7 @@ int DoSkullBob(DSWActor* actor)
const int SKULL_BOB_AMT = (Z(16));
actor->user.Counter = (actor->user.Counter + (ACTORMOVETICS << 3) + (ACTORMOVETICS << 1)) & 2047;
actor->spr.pos.Z = actor->user.sz + MulScale(SKULL_BOB_AMT, bsin(actor->user.Counter), 14) +
actor->spr.pos.Z = actor->user.pos.Z + MulScale(SKULL_BOB_AMT, bsin(actor->user.Counter), 14) +
MulScale((SKULL_BOB_AMT / 2), bsin(actor->user.Counter), 14);
return 0;
@ -628,7 +628,7 @@ int SetupBetty(DSWActor* actor)
else
{
actor->user.Counter = RANDOM_P2(2048);
actor->user.sz = actor->spr.pos.Z;
actor->user.pos.Z = actor->spr.pos.Z;
}
@ -784,7 +784,7 @@ int DoBettyBob(DSWActor* actor)
const int BETTY_BOB_AMT = (Z(16));
actor->user.Counter = (actor->user.Counter + (ACTORMOVETICS << 3) + (ACTORMOVETICS << 1)) & 2047;
actor->spr.pos.Z = actor->user.sz + MulScale(BETTY_BOB_AMT, bsin(actor->user.Counter), 14) +
actor->spr.pos.Z = actor->user.pos.Z + MulScale(BETTY_BOB_AMT, bsin(actor->user.Counter), 14) +
MulScale((BETTY_BOB_AMT / 2), bsin(actor->user.Counter), 14);
return 0;

View file

@ -52,16 +52,16 @@ void ReverseSpike(DSWActor* actor)
if (actor->user.z_tgt == actor->user.oz)
{
if (actor->spr.pos.Z == actor->user.oz)
actor->user.z_tgt = actor->user.sz;
else if (actor->user.sz == actor->user.oz)
actor->user.z_tgt = actor->user.pos.Z;
else if (actor->user.pos.Z == actor->user.oz)
actor->user.z_tgt = actor->spr.pos.Z;
}
else if (actor->user.z_tgt == actor->user.sz)
else if (actor->user.z_tgt == actor->user.pos.Z)
{
if (actor->spr.pos.Z == actor->user.oz)
actor->user.z_tgt = actor->spr.pos.Z;
else if (actor->user.sz == actor->user.oz)
actor->user.z_tgt = actor->user.sz;
else if (actor->user.pos.Z == actor->user.oz)
actor->user.z_tgt = actor->user.pos.Z;
}
actor->user.vel_rate = -actor->user.vel_rate;
@ -106,7 +106,7 @@ void SetSpikeActive(DSWActor* actor)
VatorSwitch(SP_TAG2(actor), true);
else
// moving to the OFF position
if (actor->user.z_tgt == actor->user.sz)
if (actor->user.z_tgt == actor->user.pos.Z)
VatorSwitch(SP_TAG2(actor), false);
}
@ -285,7 +285,7 @@ int DoSpike(DSWActor* actor)
if (actor->user.z_tgt == actor->spr.pos.Z)
{
// change target
actor->user.z_tgt = actor->user.sz;
actor->user.z_tgt = actor->user.pos.Z;
actor->user.vel_rate = -actor->user.vel_rate;
SetSpikeInactive(actor);
@ -295,7 +295,7 @@ int DoSpike(DSWActor* actor)
}
else
// in the OFF position
if (actor->user.z_tgt == actor->user.sz)
if (actor->user.z_tgt == actor->user.pos.Z)
{
short match = SP_TAG2(actor);
@ -390,7 +390,7 @@ int DoSpikeAuto(DSWActor* actor)
if (actor->user.z_tgt == actor->spr.pos.Z)
{
// change target
actor->user.z_tgt = actor->user.sz;
actor->user.z_tgt = actor->user.pos.Z;
actor->user.vel_rate = -actor->user.vel_rate;
actor->user.Tics = actor->user.WaitTics;
@ -399,7 +399,7 @@ int DoSpikeAuto(DSWActor* actor)
}
else
// in the DOWN position
if (actor->user.z_tgt == actor->user.sz)
if (actor->user.z_tgt == actor->user.pos.Z)
{
// change target
actor->user.jump_speed = actor->user.vel_tgt;

View file

@ -2046,7 +2046,7 @@ void SpriteSetup(void)
if (floor_vator)
{
// start off
actor->user.sz = sectp->floorz;
actor->user.pos.Z = sectp->floorz;
actor->user.z_tgt = actor->spr.pos.Z;
if (start_on)
{
@ -2055,7 +2055,7 @@ void SpriteSetup(void)
// start in the on position
sectp->addfloorz(amt);
actor->user.z_tgt = actor->user.sz;
actor->user.z_tgt = actor->user.pos.Z;
MoveSpritesWithSector(actor->spr.sector(), amt, false); // floor
}
@ -2066,7 +2066,7 @@ void SpriteSetup(void)
else
{
// start off
actor->user.sz = sectp->ceilingz;
actor->user.pos.Z = sectp->ceilingz;
actor->user.z_tgt = actor->spr.pos.Z;
if (start_on)
{
@ -2075,7 +2075,7 @@ void SpriteSetup(void)
// starting in the on position
sectp->addceilingz(amt);
actor->user.z_tgt = actor->user.sz;
actor->user.z_tgt = actor->user.pos.Z;
MoveSpritesWithSector(actor->spr.sector(), amt, true); // ceiling
}
@ -2252,13 +2252,13 @@ void SpriteSetup(void)
actor->user.zclip = floorz;
// start off
actor->user.sz = actor->user.zclip;
actor->user.pos.Z = actor->user.zclip;
actor->user.z_tgt = actor->spr.pos.Z;
if (start_on)
{
// start in the on position
actor->user.zclip = actor->spr.pos.Z;
actor->user.z_tgt = actor->user.sz;
actor->user.z_tgt = actor->user.pos.Z;
SpikeAlign(actor);
}
@ -2270,13 +2270,13 @@ void SpriteSetup(void)
actor->user.zclip = ceilingz;
// start off
actor->user.sz = actor->user.zclip;
actor->user.pos.Z = actor->user.zclip;
actor->user.z_tgt = actor->spr.pos.Z;
if (start_on)
{
// starting in the on position
actor->user.zclip = actor->spr.pos.Z;
actor->user.z_tgt = actor->user.sz;
actor->user.z_tgt = actor->user.pos.Z;
SpikeAlign(actor);
}
@ -4625,7 +4625,7 @@ int move_actor(DSWActor* actor, int xchange, int ychange, int zchange)
{
// For COOLG & HORNETS
// set to actual z before you move
actor->spr.pos.Z = actor->user.sz;
actor->spr.pos.Z = actor->user.pos.Z;
}
// save off x,y values
@ -5853,7 +5853,7 @@ KeyMain:
actorNew->spr.cstat &= ~(CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN);
actorNew->spr.cstat |= (CSTAT_SPRITE_ALIGNMENT_WALL);
SetAttach(pp->actor, actorNew);
actorNew->user.sz = ActorZOfMiddle(pp->actor); // Set mid way up who it hit
actorNew->user.pos.Z = ActorZOfMiddle(pp->actor); // Set mid way up who it hit
actorNew->user.spal = actorNew->spr.pal = actor->spr.pal; // Set the palette of the flag
SetOwner(pp->actor, actorNew); // Player now owns the flag

View file

@ -883,7 +883,7 @@ void SectorObjectSetupBounds(SECTOR_OBJECTp sop)
itActor->user.pos.X = sop->xmid - itActor->spr.pos.X;
itActor->user.pos.Y = sop->ymid - itActor->spr.pos.Y;
itActor->user.sz = sop->mid_sector->floorz - itActor->spr.pos.Z;
itActor->user.pos.Z = sop->mid_sector->floorz - itActor->spr.pos.Z;
itActor->user.Flags |= (SPR_SO_ATTACHED);
@ -914,7 +914,7 @@ void SectorObjectSetupBounds(SECTOR_OBJECTp sop)
if (sop->sectp[j] == itActor->spr.sector())
{
itActor->user.Flags |= (SPR_ON_SO_SECTOR);
itActor->user.sz = itActor->spr.sector()->floorz - itActor->spr.pos.Z;
itActor->user.pos.Z = itActor->spr.sector()->floorz - itActor->spr.pos.Z;
break;
}
}
@ -948,7 +948,7 @@ cont:
for (i = 0; sop->so_actors[i] != nullptr; i++)
{
auto actor = sop->so_actors[i];
actor->user.sz = sop->zmid - actor->spr.pos.Z;
actor->user.pos.Z = sop->zmid - actor->spr.pos.Z;
}
}
}
@ -1708,7 +1708,7 @@ PlayerPart:
if ((sop->flags & SOBJ_SPRITE_OBJ))
{
// Sprite Objects follow zmid
actor->spr.pos.Z = sop->zmid - actor->user.sz;
actor->spr.pos.Z = sop->zmid - actor->user.pos.Z;
}
else
{
@ -1716,12 +1716,12 @@ PlayerPart:
if (actor->user.Flags & (SPR_ON_SO_SECTOR))
{
// move with sector its on
actor->spr.pos.Z = actor->spr.sector()->floorz - actor->user.sz;
actor->spr.pos.Z = actor->spr.sector()->floorz - actor->user.pos.Z;
}
else
{
// move with the mid sector
actor->spr.pos.Z = sop->mid_sector->floorz - actor->user.sz;
actor->spr.pos.Z = sop->mid_sector->floorz - actor->user.pos.Z;
}
}
@ -2142,7 +2142,7 @@ void CallbackSOsink(ANIMp ap, void *data)
continue;
// move sprite WAY down in water
ndx = AnimSet(ANIM_Userz, 0, actor, -actor->user.sz - ActorSizeZ(actor) - Z(100), ap->vel>>8);
ndx = AnimSet(ANIM_Userz, 0, actor, -actor->user.pos.Z - ActorSizeZ(actor) - Z(100), ap->vel>>8);
AnimSetVelAdj(ndx, ap->vel_adj);
}
@ -3365,9 +3365,9 @@ bool ActorTrackDecide(TRACK_POINTp tpoint, DSWActor* actor)
// destination z for climbing
if (wal->twoSided())
actor->user.sz = wal->nextSector()->floorz;
actor->user.pos.Z = wal->nextSector()->floorz;
else
actor->user.sz = wal->sectorp()->ceilingz; // don't crash on bad setups.
actor->user.pos.Z = wal->sectorp()->ceilingz; // don't crash on bad setups.
DoActorZrange(actor);
@ -3529,7 +3529,7 @@ int ActorFollowTrack(DSWActor* actor, short locktics)
if (actor->user.Flags & (SPR_CLIMBING))
{
if (ActorZOfTop(actor) + (ActorSizeZ(actor) >> 2) < actor->user.sz)
if (ActorZOfTop(actor) + (ActorSizeZ(actor) >> 2) < actor->user.pos.Z)
{
actor->user.Flags &= ~(SPR_CLIMBING);

View file

@ -57,16 +57,16 @@ void ReverseVator(DSWActor* actor)
if (actor->user.z_tgt == actor->user.oz)
{
if (actor->spr.pos.Z == actor->user.oz)
actor->user.z_tgt = actor->user.sz;
else if (actor->user.sz == actor->user.oz)
actor->user.z_tgt = actor->user.pos.Z;
else if (actor->user.pos.Z == actor->user.oz)
actor->user.z_tgt = actor->spr.pos.Z;
}
else if (actor->user.z_tgt == actor->user.sz)
else if (actor->user.z_tgt == actor->user.pos.Z)
{
if (actor->spr.pos.Z == actor->user.oz)
actor->user.z_tgt = actor->spr.pos.Z;
else if (actor->user.sz == actor->user.oz)
actor->user.z_tgt = actor->user.sz;
else if (actor->user.pos.Z == actor->user.oz)
actor->user.z_tgt = actor->user.pos.Z;
}
actor->user.vel_rate = -actor->user.vel_rate;
@ -111,7 +111,7 @@ void SetVatorActive(DSWActor* actor)
VatorSwitch(SP_TAG2(actor), true);
else
// moving to the OFF position
if (actor->user.z_tgt == actor->user.sz)
if (actor->user.z_tgt == actor->user.pos.Z)
VatorSwitch(SP_TAG2(actor), false);
}
@ -388,7 +388,7 @@ int DoVator(DSWActor* actor)
if (actor->user.z_tgt == actor->spr.pos.Z)
{
// change target
actor->user.z_tgt = actor->user.sz;
actor->user.z_tgt = actor->user.pos.Z;
actor->user.vel_rate = -actor->user.vel_rate;
SetVatorInactive(actor);
@ -399,7 +399,7 @@ int DoVator(DSWActor* actor)
}
else
// in the OFF position
if (actor->user.z_tgt == actor->user.sz)
if (actor->user.z_tgt == actor->user.pos.Z)
{
short match = SP_TAG2(actor);
@ -539,7 +539,7 @@ int DoVatorAuto(DSWActor* actor)
if (actor->user.z_tgt == actor->spr.pos.Z)
{
// change target
actor->user.z_tgt = actor->user.sz;
actor->user.z_tgt = actor->user.pos.Z;
actor->user.vel_rate = -actor->user.vel_rate;
actor->user.Tics = actor->user.WaitTics;
@ -548,7 +548,7 @@ int DoVatorAuto(DSWActor* actor)
}
else
// in the DOWN position
if (actor->user.z_tgt == actor->user.sz)
if (actor->user.z_tgt == actor->user.pos.Z)
{
// change target
actor->user.jump_speed = actor->user.vel_tgt;

View file

@ -8623,7 +8623,7 @@ int DoMineStuck(DSWActor* actor)
actor->user.WaitTics = SEC(1)/2;
}
vec3_t pos = { attachActor->spr.pos.X, attachActor->spr.pos.Y, attachActor->spr.pos.Z - actor->user.sz };
vec3_t pos = { attachActor->spr.pos.X, attachActor->spr.pos.Y, attachActor->spr.pos.Z - actor->user.pos.Z };
SetActorZ(actor, &pos);
actor->spr.pos.Z = attachActor->spr.pos.Z - (ActorSizeZ(attachActor) >> 1);
}
@ -8822,7 +8822,7 @@ int DoMine(DSWActor* actor)
// attach weapon to sprite
SetAttach(hitActor, actor);
actor->user.sz = hitActor->spr.pos.Z - actor->spr.pos.Z;
actor->user.pos.Z = hitActor->spr.pos.Z - actor->spr.pos.Z;
auto own = GetOwner(actor);
if (own && own->hasU())
@ -9038,7 +9038,7 @@ int DoEMPBurst(DSWActor* actor)
DSWActor* attachActor = actor->user.attachActor;
if (attachActor != nullptr)
{
vec3_t pos = { attachActor->spr.pos.X, attachActor->spr.pos.Y, attachActor->spr.pos.Z - actor->user.sz };
vec3_t pos = { attachActor->spr.pos.X, attachActor->spr.pos.Y, attachActor->spr.pos.Z - actor->user.pos.Z };
SetActorZ(actor, &pos);
actor->spr.ang = NORM_ANGLE(attachActor->spr.ang+1024);
}
@ -10210,7 +10210,7 @@ void AddSpriteToSectorObject(DSWActor* actor, SECTOR_OBJECTp sop)
actor->user.pos.X = sop->xmid - actor->spr.pos.X;
actor->user.pos.Y = sop->ymid - actor->spr.pos.Y;
actor->user.sz = sop->mid_sector->floorz - actor->spr.pos.Z;
actor->user.pos.Z = sop->mid_sector->floorz - actor->spr.pos.Z;
actor->user.sang = actor->spr.ang;
}
@ -10260,19 +10260,19 @@ void SpawnBigGunFlames(DSWActor* actor, DSWActor* Operator, SECTOR_OBJECTp sop,
if (actor->user.Flags & (SPR_ON_SO_SECTOR))
{
// move with sector its on
expActor->spr.pos.Z = actor->spr.sector()->floorz - actor->user.sz;
expActor->spr.pos.Z = actor->spr.sector()->floorz - actor->user.pos.Z;
expActor->spr.backupz();
}
else
{
// move with the mid sector
expActor->spr.pos.Z = sop->mid_sector->floorz - actor->user.sz;
expActor->spr.pos.Z = sop->mid_sector->floorz - actor->user.pos.Z;
expActor->spr.backupz();
}
expActor->user.pos.X = actor->user.pos.X;
expActor->user.pos.Y = actor->user.pos.Y;
expActor->user.sz = actor->user.sz;
expActor->user.pos.Z = actor->user.pos.Z;
}
void SpawnGrenadeSecondaryExp(DSWActor* actor, int ang)
@ -11260,7 +11260,7 @@ void InitSpellRing(PLAYERp pp)
actorNew->spr.yrepeat = 32;
actorNew->spr.zvel = 0;
actorNew->user.sz = Z(20);
actorNew->user.pos.Z = Z(20);
actorNew->user.Dist = RING_INNER_DIST;
actorNew->user.Counter = max_missiles;
actorNew->user.Counter2 = 0;
@ -11303,8 +11303,8 @@ int DoSerpRing(DSWActor* actor)
actor->spr.pos.Y = own->spr.pos.Y;
actor->spr.pos.Z += actor->spr.zvel;
if (actor->spr.pos.Z > own->spr.pos.Z - actor->user.sz)
actor->spr.pos.Z = own->spr.pos.Z - actor->user.sz;
if (actor->spr.pos.Z > own->spr.pos.Z - actor->user.pos.Z)
actor->spr.pos.Z = own->spr.pos.Z - actor->user.pos.Z;
// go out until its time to come back in
if (actor->user.Counter2 == false)
@ -11539,7 +11539,7 @@ int InitSerpRing(DSWActor* actor)
actorNew->spr.pal = 0;
actorNew->spr.pos.Z = ActorZOfTop(actor) - Z(20);
actorNew->user.sz = Z(50);
actorNew->user.pos.Z = Z(50);
// ang around the serp is now slide_ang
actorNew->user.slide_ang = actorNew->spr.ang;
@ -12297,7 +12297,7 @@ int InitSumoSkull(DSWActor* actor)
actorNew->user.Attrib = &SkullAttrib;
DoActorSetSpeed(actor, NORM_SPEED);
actorNew->user.Counter = RANDOM_P2(2048);
actorNew->user.sz = actorNew->spr.pos.Z;
actorNew->user.pos.Z = actorNew->spr.pos.Z;
actorNew->user.Health = 100;
// defaults do change the statnum