diff --git a/source/games/sw/src/coolg.cpp b/source/games/sw/src/coolg.cpp index bfdd317ae..eea46afbd 100644 --- a/source/games/sw/src/coolg.cpp +++ b/source/games/sw/src/coolg.cpp @@ -505,7 +505,7 @@ void CoolgCommon(DSWActor* actor) actor->user.floor_dist = (16); actor->user.ceiling_dist = (20); - actor->user.pos.Z = actor->int_pos().Z; + actor->user.pos.Z = actor->spr.pos.Z; actor->spr.xrepeat = 42; actor->spr.yrepeat = 42; @@ -623,9 +623,9 @@ int DoCoolgMatchPlayerZ(DSWActor* actor) if (labs(zdiff) > zdist) { if (zdiff > 0) - actor->user.pos.Z += 170 * ACTORMOVETICS; + actor->user.pos.Z += 170 * ACTORMOVETICS * zmaptoworld; else - actor->user.pos.Z -= 170 * ACTORMOVETICS; + actor->user.pos.Z -= 170 * ACTORMOVETICS * zmaptoworld; } // save off lo and hi z @@ -644,7 +644,7 @@ int DoCoolgMatchPlayerZ(DSWActor* actor) if (actor->user.int_upos().Z > bound) { - actor->user.pos.Z = bound; + actor->user.pos.Z = bound * zinttoworld; } // upper bound @@ -655,11 +655,11 @@ int DoCoolgMatchPlayerZ(DSWActor* actor) if (actor->user.int_upos().Z < bound) { - actor->user.pos.Z = bound; + actor->user.pos.Z = bound * zinttoworld; } - actor->user.pos.Z = min(actor->user.int_upos().Z, loz - actor->user.int_floor_dist()); - actor->user.pos.Z = max(actor->user.int_upos().Z, hiz + actor->user.int_ceiling_dist()); + actor->user.pos.Z = min(actor->user.int_upos().Z, loz - actor->user.int_floor_dist()) * zinttoworld; + actor->user.pos.Z = max(actor->user.int_upos().Z, hiz + actor->user.int_ceiling_dist()) * zinttoworld; actor->user.Counter = (actor->user.Counter + (ACTORMOVETICS<<3)) & 2047; actor->set_int_z(actor->user.int_upos().Z + MulScale(COOLG_BOB_AMT, bsin(actor->user.Counter), 14)); @@ -668,7 +668,8 @@ int DoCoolgMatchPlayerZ(DSWActor* actor) if (actor->int_pos().Z < bound) { // bumped something - actor->set_int_z(actor->user.pos.Z = bound + COOLG_BOB_AMT); + actor->set_int_z(bound + COOLG_BOB_AMT); + actor->user.pos.Z = actor->spr.pos.Z; } return 0; @@ -719,13 +720,13 @@ int DoCoolgCircle(DSWActor* actor) } // move in the z direction - actor->user.pos.Z -= actor->user.jump_speed * ACTORMOVETICS; + actor->user.pos.Z -= actor->user.jump_speed * ACTORMOVETICS * zinttoworld; bound = actor->user.int_hiz() + actor->user.int_ceiling_dist() + COOLG_BOB_AMT; if (actor->user.int_upos().Z < bound) { // bumped something - actor->user.pos.Z = bound; + actor->user.pos.Z = bound * zinttoworld; InitActorReposition(actor); return 0; } diff --git a/source/games/sw/src/eel.cpp b/source/games/sw/src/eel.cpp index f3fd32327..0961a68d0 100644 --- a/source/games/sw/src/eel.cpp +++ b/source/games/sw/src/eel.cpp @@ -444,9 +444,9 @@ int DoEelMatchPlayerZ(DSWActor* actor) { if (zdiff > 0) // manipulate the z midpoint - actor->user.pos.Z += 160 * ACTORMOVETICS; + actor->user.pos.Z += 160 * ACTORMOVETICS * zmaptoworld; else - actor->user.pos.Z -= 160 * ACTORMOVETICS; + actor->user.pos.Z -= 160 * ACTORMOVETICS * zmaptoworld; } const int EEL_BOB_AMT = (Z(4)); @@ -473,7 +473,7 @@ int DoEelMatchPlayerZ(DSWActor* actor) if (actor->user.int_upos().Z > bound) { - actor->user.pos.Z = bound; + actor->user.pos.Z = bound * zinttoworld; } // upper bound @@ -490,11 +490,11 @@ int DoEelMatchPlayerZ(DSWActor* actor) if (actor->user.int_upos().Z < bound) { - actor->user.pos.Z = bound; + actor->user.pos.Z = bound * zinttoworld; } - actor->user.pos.Z = min(actor->user.int_upos().Z, loz - actor->user.int_floor_dist()); - actor->user.pos.Z = max(actor->user.int_upos().Z, hiz + actor->user.int_ceiling_dist()); + actor->user.pos.Z = min(actor->user.int_upos().Z, loz - actor->user.int_floor_dist()) * zinttoworld; + actor->user.pos.Z = max(actor->user.int_upos().Z, hiz + actor->user.int_ceiling_dist()) * zinttoworld; actor->user.Counter = (actor->user.Counter + (ACTORMOVETICS << 3) + (ACTORMOVETICS << 1)) & 2047; actor->set_int_z(actor->user.int_upos().Z + MulScale(EEL_BOB_AMT, bsin(actor->user.Counter), 14)); @@ -503,7 +503,8 @@ int DoEelMatchPlayerZ(DSWActor* actor) if (actor->int_pos().Z < bound) { // bumped something - actor->set_int_z(actor->user.pos.Z = bound + EEL_BOB_AMT); + actor->set_int_z(bound + EEL_BOB_AMT); + actor->user.pos.Z = actor->spr.pos.Z; } return 0; diff --git a/source/games/sw/src/game.h b/source/games/sw/src/game.h index 448ede503..49f768f0f 100644 --- a/source/games/sw/src/game.h +++ b/source/games/sw/src/game.h @@ -937,7 +937,7 @@ struct USER 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; } - const vec3_t int_upos() const { return pos; } + const vec3_t int_upos() const { return { int(pos.X * worldtoint), int(pos.Y * worldtoint),int(pos.Z * zworldtoint) }; } // // Variables that can be used by actors and Player @@ -969,13 +969,7 @@ struct USER TObjPtr flagOwnerActor; TObjPtr WpnGoalActor; - // Some actors hijack this - the second name is supposed to be a marker for these cases - union - { - vec3_t pos; - vec3_t notreallypos; - }; - + DVector3 pos; double hiz, loz; double oz; // serialized copy of sprite.oz double z_tgt; @@ -2242,7 +2236,7 @@ struct ANIM break; case ANIM_Userz: if (animactor == nullptr) return; - animactor->user.pos.Z = value; + animactor->user.pos.Z = value * inttoworld; break; case ANIM_SUdepth: sector[animindex].depth_fixed = value; diff --git a/source/games/sw/src/hornet.cpp b/source/games/sw/src/hornet.cpp index d49ede582..ae1da967d 100644 --- a/source/games/sw/src/hornet.cpp +++ b/source/games/sw/src/hornet.cpp @@ -312,7 +312,7 @@ int SetupHornet(DSWActor* actor) actor->user.floor_dist = (16); actor->user.ceiling_dist = (16); - actor->user.pos.Z = actor->int_pos().Z; + actor->user.pos.Z = actor->spr.pos.Z; actor->spr.xrepeat = 37; actor->spr.yrepeat = 32; @@ -354,9 +354,9 @@ int DoHornetMatchPlayerZ(DSWActor* actor) if (zdiff > 0) // manipulate the z midpoint //actor->user.sz += 256 * ACTORMOVETICS; - actor->user.pos.Z += 1024 * ACTORMOVETICS; + actor->user.pos.Z += 1024 * ACTORMOVETICS * zmaptoworld; else - actor->user.pos.Z -= 256 * ACTORMOVETICS; + actor->user.pos.Z -= 256 * ACTORMOVETICS * zmaptoworld; } // save off lo and hi z @@ -375,7 +375,7 @@ int DoHornetMatchPlayerZ(DSWActor* actor) if (actor->user.int_upos().Z > bound) { - actor->user.pos.Z = bound; + actor->user.pos.Z = bound * zinttoworld; } // upper bound @@ -386,11 +386,11 @@ int DoHornetMatchPlayerZ(DSWActor* actor) if (actor->user.int_upos().Z < bound) { - actor->user.pos.Z = bound; + actor->user.pos.Z = bound * zinttoworld; } - actor->user.pos.Z = min(actor->user.int_upos().Z, loz - actor->user.int_floor_dist()); - actor->user.pos.Z = max(actor->user.int_upos().Z, hiz + actor->user.int_ceiling_dist()); + actor->user.pos.Z = min(actor->user.int_upos().Z, loz - actor->user.int_floor_dist()) * zinttoworld; + actor->user.pos.Z = max(actor->user.int_upos().Z, hiz + actor->user.int_ceiling_dist()) * zinttoworld; actor->user.Counter = (actor->user.Counter + (ACTORMOVETICS << 3) + (ACTORMOVETICS << 1)) & 2047; actor->set_int_z(actor->user.int_upos().Z + MulScale(HORNET_BOB_AMT, bsin(actor->user.Counter), 14)); @@ -399,7 +399,8 @@ int DoHornetMatchPlayerZ(DSWActor* actor) if (actor->int_pos().Z < bound) { // bumped something - actor->set_int_z(actor->user.pos.Z = bound + HORNET_BOB_AMT); + actor->set_int_z(bound + HORNET_BOB_AMT); + actor->user.pos.Z = actor->spr.pos.Z; } return 0; @@ -461,13 +462,13 @@ int DoHornetCircle(DSWActor* actor) } // move in the z direction - actor->user.pos.Z -= actor->user.jump_speed * ACTORMOVETICS; + actor->user.pos.Z -= actor->user.jump_speed * ACTORMOVETICS * zinttoworld; bound = actor->user.int_hiz() + actor->user.int_ceiling_dist() + HORNET_BOB_AMT; if (actor->user.int_upos().Z < bound) { // bumped something - actor->user.pos.Z = bound; + actor->user.pos.Z = bound * zinttoworld; InitActorReposition(actor); return 0; } diff --git a/source/games/sw/src/jweapon.cpp b/source/games/sw/src/jweapon.cpp index 58b5a28da..bc559425a 100644 --- a/source/games/sw/src/jweapon.cpp +++ b/source/games/sw/src/jweapon.cpp @@ -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.notreallypos.Z != actor->user.notreallypos.Y) + if (actor->user.pos.Z != actor->user.pos.Y) { // if you are between the ceiling and floor fall fast - if (actor->int_pos().Z > actor->user.notreallypos.Y && actor->int_pos().Z < actor->user.notreallypos.Z) + if (actor->spr.pos.Z > actor->user.pos.Y && actor->spr.pos.Z < actor->user.pos.Z) { actor->spr.zvel += 300; actor->add_int_z(actor->spr.zvel); @@ -453,9 +453,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->int_pos().X, actor->int_pos().Y, &actor->user.notreallypos.Y, &actor->user.notreallypos.Z); + getzsofslopeptr(bldActor->tempwall->nextSector(), actor->spr.pos.X, actor->spr.pos.Y, &actor->user.pos.Y, &actor->user.pos.Z); else - actor->user.notreallypos.Y = actor->user.notreallypos.Z; // 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); @@ -2143,7 +2143,7 @@ int DoFlag(DSWActor* actor) // attach weapon to sprite actor->spr.cstat &= ~(CSTAT_SPRITE_BLOCK | CSTAT_SPRITE_BLOCK_HITSCAN); SetAttach(hitActor, actor); - actor->user.pos.Z = hitActor->int_pos().Z - (ActorSizeZ(hitActor) >> 1); + actor->user.pos.Z = hitActor->spr.pos.Z - (ActorSizeZ(hitActor) >> 1) * zinttoworld; } } diff --git a/source/games/sw/src/player.cpp b/source/games/sw/src/player.cpp index 71e17a66c..11b57f318 100644 --- a/source/games/sw/src/player.cpp +++ b/source/games/sw/src/player.cpp @@ -4021,10 +4021,10 @@ void DoPlayerWarpToUnderwater(PLAYER* pp) PRODUCTION_ASSERT(Found == true); // get the offset from the sprite - plActor->user.pos.XY() = over_act->int_pos().XY() - pp->int_ppos().XY(); + plActor->user.pos.XY() = over_act->spr.pos.XY() - pp->pos.XY(); // update to the new x y position - pp->set_int_ppos_XY(under_act->int_pos().XY() - plActor->user.int_upos().XY()); + pp->pos.XY() = under_act->spr.pos.XY() - plActor->user.pos.XY(); auto over = over_act->sector(); auto under = under_act->sector(); @@ -4087,10 +4087,10 @@ void DoPlayerWarpToSurface(PLAYER* pp) PRODUCTION_ASSERT(Found == true); // get the offset from the under sprite - plActor->user.pos.XY() = under_act->int_pos().XY() - pp->int_ppos().XY(); + plActor->user.pos.XY() = under_act->spr.pos.XY() - pp->pos.XY(); // update to the new x y position - pp->set_int_ppos_XY(over_act->int_pos().XY() - plActor->user.int_upos().XY()); + pp->pos.XY() = over_act->spr.pos.XY() - plActor->user.pos.XY(); auto over = over_act->sector(); auto under = under_act->sector(); diff --git a/source/games/sw/src/skull.cpp b/source/games/sw/src/skull.cpp index 1d549deff..99868829e 100644 --- a/source/games/sw/src/skull.cpp +++ b/source/games/sw/src/skull.cpp @@ -243,7 +243,7 @@ int SetupSkull(DSWActor* actor) else { actor->user.Counter = RANDOM_P2(2048); - actor->user.pos.Z = actor->int_pos().Z; + actor->user.pos.Z = actor->spr.pos.Z; } @@ -628,7 +628,7 @@ int SetupBetty(DSWActor* actor) else { actor->user.Counter = RANDOM_P2(2048); - actor->user.pos.Z = actor->int_pos().Z; + actor->user.pos.Z = actor->spr.pos.Z; } diff --git a/source/games/sw/src/sprite.cpp b/source/games/sw/src/sprite.cpp index 0624349f5..732e3f88a 100644 --- a/source/games/sw/src/sprite.cpp +++ b/source/games/sw/src/sprite.cpp @@ -2042,7 +2042,7 @@ void SpriteSetup(void) if (floor_vator) { // start off - actor->user.pos.Z = sectp->int_floorz(); + actor->user.pos.Z = sectp->floorz; actor->user.z_tgt = actor->spr.pos.Z; if (start_on) { @@ -2063,7 +2063,7 @@ void SpriteSetup(void) else { // start off - actor->user.pos.Z = sectp->int_ceilingz(); + actor->user.pos.Z = sectp->ceilingz; actor->user.z_tgt = actor->spr.pos.Z; if (start_on) { @@ -2250,13 +2250,13 @@ void SpriteSetup(void) actor->user.zclip = florz * zinttoworld; // start off - actor->user.pos.Z = actor->user.int_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.int_upos().Z * zinttoworld; + actor->user.z_tgt = actor->user.pos.Z; SpikeAlign(actor); } @@ -2269,13 +2269,13 @@ void SpriteSetup(void) actor->user.zclip = ceilz * zinttoworld; // start off - actor->user.pos.Z = actor->user.int_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.int_upos().Z * zinttoworld; + actor->user.z_tgt = actor->user.pos.Z; SpikeAlign(actor); } @@ -5836,7 +5836,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.pos.Z = int_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 diff --git a/source/games/sw/src/track.cpp b/source/games/sw/src/track.cpp index 85e27a3d5..0ae1716ad 100644 --- a/source/games/sw/src/track.cpp +++ b/source/games/sw/src/track.cpp @@ -870,9 +870,8 @@ void SectorObjectSetupBounds(SECTOR_OBJECT* sop) } - itActor->user.pos.X = sop->int_pmid().X - itActor->int_pos().X; - itActor->user.pos.Y = sop->int_pmid().Y - itActor->int_pos().Y; - itActor->user.pos.Z = sop->mid_sector->int_floorz() - itActor->int_pos().Z; + itActor->user.pos.XY() = sop->pmid.XY() - itActor->spr.pos.XY(); + itActor->user.pos.Z = sop->mid_sector->floorz - itActor->spr.pos.Z; itActor->user.Flags |= (SPR_SO_ATTACHED); @@ -903,7 +902,7 @@ void SectorObjectSetupBounds(SECTOR_OBJECT* sop) if (sop->sectp[j] == itActor->sector()) { itActor->user.Flags |= (SPR_ON_SO_SECTOR); - itActor->user.pos.Z = itActor->sector()->int_floorz() - itActor->int_pos().Z; + itActor->user.pos.Z = itActor->sector()->floorz - itActor->spr.pos.Z; break; } } @@ -937,7 +936,7 @@ cont: for (i = 0; sop->so_actors[i] != nullptr; i++) { auto actor = sop->so_actors[i]; - actor->user.pos.Z = sop->int_pmid().Z - actor->int_pos().Z; + actor->user.pos.Z = sop->pmid.Z - actor->spr.pos.Z; } } } @@ -3288,7 +3287,7 @@ bool ActorTrackDecide(TRACK_POINT* tpoint, DSWActor* actor) if (actor->user.ActorActionSet->Jump) { - int bos_z,nx,ny; + int nx,ny; HitInfo near; // @@ -3333,9 +3332,9 @@ bool ActorTrackDecide(TRACK_POINT* tpoint, DSWActor* actor) // destination z for climbing if (wal->twoSided()) - actor->user.pos.Z = wal->nextSector()->int_floorz(); + actor->user.pos.Z = wal->nextSector()->floorz; else - actor->user.pos.Z = wal->sectorp()->int_ceilingz(); // don't crash on bad setups. + actor->user.pos.Z = wal->sectorp()->ceilingz; // don't crash on bad setups. DoActorZrange(actor); @@ -3344,11 +3343,11 @@ bool ActorTrackDecide(TRACK_POINT* tpoint, DSWActor* actor) // actor->spr.cstat |= (CSTAT_SPRITE_YCENTER); - bos_z = ActorZOfBottom(actor); - if (bos_z > actor->user.int_loz()) + double bos_z = ActorZOfBottom(actor) * zinttoworld; + if (bos_z > actor->user.loz) { - actor->user.notreallypos.Y = (bos_z - actor->int_pos().Z); - actor->add_int_z(-actor->user.notreallypos.Y); + actor->user.pos.Y = (bos_z - actor->spr.pos.Z); + actor->spr.pos.Z -= actor->user.pos.Y; } // @@ -3507,7 +3506,7 @@ int ActorFollowTrack(DSWActor* actor, short locktics) ActorLeaveTrack(actor); actor->spr.cstat &= ~(CSTAT_SPRITE_YCENTER); - actor->add_int_z(actor->user.notreallypos.Y); + actor->spr.pos.Z += actor->user.pos.Y; DoActorSetSpeed(actor, SLOW_SPEED); actor->user.ActorActionFunc = NinjaJumpActionFunc; diff --git a/source/games/sw/src/wallmove.cpp b/source/games/sw/src/wallmove.cpp index b4e923f70..c4474673a 100644 --- a/source/games/sw/src/wallmove.cpp +++ b/source/games/sw/src/wallmove.cpp @@ -142,8 +142,8 @@ int DoWallMove(DSWActor* actor) if (SOsprite) { // move the sprite offset from center - actor->user.pos.X -= nx; - actor->user.pos.Y -= ny; + actor->user.pos.X -= nx * inttoworld; + actor->user.pos.Y -= ny * inttoworld; } else { diff --git a/source/games/sw/src/weapon.cpp b/source/games/sw/src/weapon.cpp index 99e15c541..8247adc3d 100644 --- a/source/games/sw/src/weapon.cpp +++ b/source/games/sw/src/weapon.cpp @@ -3725,8 +3725,10 @@ AutoShrap: case Vomit1: shrap_bounce = false; actor->spr.pos.Z -= 4; - shrap_xsize = actor->user.notreallypos.X = 12 + (RANDOM_P2(32<<8)>>8); - shrap_ysize = actor->user.notreallypos.Y = 12 + (RANDOM_P2(32<<8)>>8); + shrap_xsize = 12 + (RANDOM_P2(32<<8)>>8); + shrap_ysize = 12 + (RANDOM_P2(32<<8)>>8); + actor->user.pos.X = shrap_xsize; // notreallypos + actor->user.pos.Y = shrap_ysize; actor->user.Counter = (RANDOM_P2(2048<<5)>>5); nx = bcos(actor->int_ang(), -6); @@ -3740,8 +3742,10 @@ AutoShrap: case EMP: shrap_bounce = false; actor->spr.pos.Z -= 4; - shrap_xsize = actor->user.notreallypos.X = 5 + (RANDOM_P2(4<<8)>>8); - shrap_ysize = actor->user.notreallypos.Y = 5 + (RANDOM_P2(4<<8)>>8); + shrap_xsize = 5 + (RANDOM_P2(4<<8)>>8); + shrap_ysize = 5 + (RANDOM_P2(4<<8)>>8); + actor->user.pos.X = shrap_xsize; // notreallypos + actor->user.pos.Y = shrap_ysize; break; } @@ -3794,8 +3798,9 @@ void DoShrapMove(DSWActor* actor) int DoVomit(DSWActor* actor) { actor->user.Counter = NORM_ANGLE(actor->user.Counter + (30*MISSILEMOVETICS)); - actor->spr.xrepeat = actor->user.notreallypos.X + MulScale(12, bcos(actor->user.Counter), 14); - actor->spr.yrepeat = actor->user.notreallypos.Y + MulScale(12, bsin(actor->user.Counter), 14); + // notreallypos + actor->spr.xrepeat = int(actor->user.pos.X) + MulScale(12, bcos(actor->user.Counter), 14); + actor->spr.yrepeat = int(actor->user.pos.Y) + MulScale(12, bsin(actor->user.Counter), 14); if (actor->user.Flags & (SPR_JUMPING)) { DoJump(actor); @@ -3815,8 +3820,9 @@ int DoVomit(DSWActor* actor) MissileWaterAdjust(actor); actor->spr.pos.Z = actor->user.loz; actor->user.WaitTics = 60; - actor->user.notreallypos.X = actor->spr.xrepeat; - actor->user.notreallypos.Y = actor->spr.yrepeat; + // notreallypos + actor->user.pos.X = actor->spr.xrepeat; + actor->user.pos.Y = actor->spr.yrepeat; return 0; } @@ -8826,7 +8832,7 @@ int DoMine(DSWActor* actor) // attach weapon to sprite SetAttach(hitActor, actor); - actor->user.pos.Z = hitActor->int_pos().Z - actor->int_pos().Z; + actor->user.pos.Z = hitActor->spr.pos.Z - actor->spr.pos.Z; auto own = GetOwner(actor); if (own && own->hasU()) @@ -10210,9 +10216,8 @@ void AddSpriteToSectorObject(DSWActor* actor, SECTOR_OBJECT* sop) actor->user.Flags |= (SPR_ON_SO_SECTOR|SPR_SO_ATTACHED); - actor->user.pos.X = sop->int_pmid().X - actor->int_pos().X; - actor->user.pos.Y = sop->int_pmid().Y - actor->int_pos().Y; - actor->user.pos.Z = sop->mid_sector->int_floorz() - actor->int_pos().Z; + actor->user.pos.XY() = sop->pmid.XY() - actor->spr.pos.XY(); + actor->user.pos.Z = sop->mid_sector->floorz - actor->spr.pos.Z; actor->user.sang = actor->int_ang(); } @@ -10262,17 +10267,17 @@ void SpawnBigGunFlames(DSWActor* actor, DSWActor* Operator, SECTOR_OBJECT* sop, if (actor->user.Flags & (SPR_ON_SO_SECTOR)) { // move with sector its on - expActor->set_int_z(actor->sector()->int_floorz() - actor->user.int_upos().Z); + expActor->spr.pos.Z = actor->sector()->floorz - actor->user.pos.Z; expActor->backupz(); } else { // move with the mid sector - expActor->set_int_z(sop->mid_sector->int_floorz() - actor->user.int_upos().Z); + expActor->spr.pos.Z = sop->mid_sector->floorz - actor->user.pos.Z; expActor->backupz(); } - expActor->user.pos = actor->user.int_upos(); + expActor->user.pos = actor->user.pos; } void SpawnGrenadeSecondaryExp(DSWActor* actor, int ang) @@ -11244,12 +11249,12 @@ void InitSpellRing(PLAYER* pp) actorNew->spr.yrepeat = 32; actorNew->spr.zvel = 0; - actorNew->user.pos.Z = Z(20); + actorNew->user.pos.Z = 20; actorNew->user.Dist = RING_INNER_DIST; actorNew->user.Counter = max_missiles; actorNew->user.Counter2 = 0; - actorNew->user.ceiling_dist = (10); - actorNew->user.floor_dist = (10); + actorNew->user.ceiling_dist = 10; + actorNew->user.floor_dist = 10; // put it out there actorNew->add_int_pos({ MulScale(actorNew->user.Dist, bcos(actorNew->int_ang()), 14), MulScale(actorNew->user.Dist, bsin(actorNew->int_ang()), 14), @@ -11521,7 +11526,7 @@ int InitSerpRing(DSWActor* actor) actorNew->spr.pal = 0; actorNew->set_int_z(ActorZOfTop(actor) - Z(20)); - actorNew->user.pos.Z = Z(50); + actorNew->user.pos.Z = 50; // ang around the serp is now slide_ang actorNew->user.slide_ang = actorNew->int_ang(); @@ -12261,7 +12266,7 @@ int InitSumoSkull(DSWActor* actor) actorNew->user.Attrib = &SkullAttrib; DoActorSetSpeed(actor, NORM_SPEED); actorNew->user.Counter = RANDOM_P2(2048); - actorNew->user.pos.Z = actorNew->int_pos().Z; + actorNew->user.pos.Z = actorNew->spr.pos.Z; actorNew->user.Health = 100; // defaults do change the statnum @@ -17083,10 +17088,11 @@ DSWActor* SpawnBubble(DSWActor* actor) actorNew->spr.xrepeat = 8 + (RANDOM_P2(8 << 8) >> 8); actorNew->spr.yrepeat = actorNew->spr.xrepeat; - actorNew->user.notreallypos.X = actorNew->spr.xrepeat; - actorNew->user.notreallypos.Y = actorNew->spr.yrepeat; - actorNew->user.ceiling_dist = (1); - actorNew->user.floor_dist = (1); + // notreallypos + actorNew->user.pos.X = actorNew->spr.xrepeat; + actorNew->user.pos.Y = actorNew->spr.yrepeat; + actorNew->user.ceiling_dist = 1; + actorNew->user.floor_dist = 1; actorNew->spr.shade = actor->sector()->floorshade - 10; actorNew->user.WaitTics = 120 * 120; actorNew->spr.zvel = 512; @@ -17175,17 +17181,18 @@ int DoBubble(DSWActor* actor) if (actor->spr.zvel > 768) actor->spr.zvel = 768; - actor->user.notreallypos.X += 1; - actor->user.notreallypos.Y += 1; + // notreallypos + actor->user.pos.X += 1; + actor->user.pos.Y += 1; - if (actor->user.notreallypos.X > 32) + if (actor->user.pos.X > 32) { - actor->user.notreallypos.X = 32; - actor->user.notreallypos.Y = 32; + actor->user.pos.X = 32; + actor->user.pos.Y = 32; } - actor->spr.xrepeat = actor->user.notreallypos.X + (RANDOM_P2(8 << 8) >> 8) - 4; - actor->spr.yrepeat = actor->user.notreallypos.Y + (RANDOM_P2(8 << 8) >> 8) - 4; + actor->spr.xrepeat = int(actor->user.pos.X) + (RANDOM_P2(8 << 8) >> 8) - 4; + actor->spr.yrepeat = int(actor->user.pos.Y) + (RANDOM_P2(8 << 8) >> 8) - 4; if (actor->spr.pos.Z < actor->sector()->ceilingz) {