- SW: third batch of spr.pos wraps.

This commit is contained in:
Christoph Oelckers 2022-02-01 19:41:58 +01:00
parent 8ca4d85069
commit 53ce186e7b
2 changed files with 27 additions and 56 deletions

View file

@ -3516,9 +3516,7 @@ int ActorCoughItem(DSWActor* actor)
actorNew = insertActor(actor->sector(), STAT_SPAWN_ITEMS); actorNew = insertActor(actor->sector(), STAT_SPAWN_ITEMS);
actorNew->spr.cstat = 0; actorNew->spr.cstat = 0;
actorNew->spr.extra = 0; actorNew->spr.extra = 0;
actorNew->spr.pos.X = actor->spr.pos.X; actorNew->set_int_pos({ actor->spr.pos.X, actor->spr.pos.Y, ActorZOfMiddle(actor) });
actorNew->spr.pos.Y = actor->spr.pos.Y;
actorNew->spr.pos.Z = ActorZOfMiddle(actor);
actorNew->spr.ang = 0; actorNew->spr.ang = 0;
actorNew->spr.extra = 0; actorNew->spr.extra = 0;
@ -3557,9 +3555,7 @@ int ActorCoughItem(DSWActor* actor)
actorNew = insertActor(actor->sector(), STAT_SPAWN_ITEMS); actorNew = insertActor(actor->sector(), STAT_SPAWN_ITEMS);
actorNew->spr.cstat = 0; actorNew->spr.cstat = 0;
actorNew->spr.extra = 0; actorNew->spr.extra = 0;
actorNew->spr.pos.X = actor->spr.pos.X; actorNew->set_int_pos({ actor->spr.pos.X, actor->spr.pos.Y, ActorZOfMiddle(actor) });
actorNew->spr.pos.Y = actor->spr.pos.Y;
actorNew->spr.pos.Z = ActorZOfMiddle(actor);
actorNew->spr.ang = 0; actorNew->spr.ang = 0;
actorNew->spr.extra = 0; actorNew->spr.extra = 0;
@ -3585,9 +3581,7 @@ int ActorCoughItem(DSWActor* actor)
actorNew = insertActor(actor->sector(), STAT_SPAWN_ITEMS); actorNew = insertActor(actor->sector(), STAT_SPAWN_ITEMS);
actorNew->spr.cstat = 0; actorNew->spr.cstat = 0;
actorNew->spr.extra = 0; actorNew->spr.extra = 0;
actorNew->spr.pos.X = actor->spr.pos.X; actorNew->set_int_pos({ actor->spr.pos.X, actor->spr.pos.Y, ActorZOfMiddle(actor) });
actorNew->spr.pos.Y = actor->spr.pos.Y;
actorNew->spr.pos.Z = ActorZOfMiddle(actor);
actorNew->spr.ang = 0; actorNew->spr.ang = 0;
actorNew->spr.extra = 0; actorNew->spr.extra = 0;
@ -3616,9 +3610,7 @@ int ActorCoughItem(DSWActor* actor)
actorNew = insertActor(actor->sector(), STAT_SPAWN_ITEMS); actorNew = insertActor(actor->sector(), STAT_SPAWN_ITEMS);
actorNew->spr.cstat = 0; actorNew->spr.cstat = 0;
actorNew->spr.extra = 0; actorNew->spr.extra = 0;
actorNew->spr.pos.X = actor->spr.pos.X; actorNew->set_int_pos({ actor->spr.pos.X, actor->spr.pos.Y, ActorZOfMiddle(actor) });
actorNew->spr.pos.Y = actor->spr.pos.Y;
actorNew->spr.pos.Z = ActorZOfMiddle(actor);
actorNew->spr.ang = 0; actorNew->spr.ang = 0;
actorNew->spr.extra = 0; actorNew->spr.extra = 0;
@ -3678,9 +3670,7 @@ int ActorCoughItem(DSWActor* actor)
actorNew = insertActor(actor->sector(), STAT_SPAWN_ITEMS); actorNew = insertActor(actor->sector(), STAT_SPAWN_ITEMS);
actorNew->spr.cstat = 0; actorNew->spr.cstat = 0;
actorNew->spr.extra = 0; actorNew->spr.extra = 0;
actorNew->spr.pos.X = actor->spr.pos.X; actorNew->set_int_pos({ actor->spr.pos.X, actor->spr.pos.Y, ActorZOfMiddle(actor) });
actorNew->spr.pos.Y = actor->spr.pos.Y;
actorNew->spr.pos.Z = ActorZOfMiddle(actor);
actorNew->spr.ang = 0; actorNew->spr.ang = 0;
actorNew->spr.extra = 0; actorNew->spr.extra = 0;
@ -3736,9 +3726,7 @@ int ActorCoughItem(DSWActor* actor)
actorNew = insertActor(actor->sector(), STAT_SPAWN_ITEMS); actorNew = insertActor(actor->sector(), STAT_SPAWN_ITEMS);
actorNew->spr.cstat = 0; actorNew->spr.cstat = 0;
actorNew->spr.extra = 0; actorNew->spr.extra = 0;
actorNew->spr.pos.X = actor->spr.pos.X; actorNew->set_int_pos({ actor->spr.pos.X, actor->spr.pos.Y, ActorLowerZ(actor) + Z(10) });
actorNew->spr.pos.Y = actor->spr.pos.Y;
actorNew->spr.pos.Z = ActorLowerZ(actor) + Z(10);
actorNew->spr.ang = actor->spr.ang; actorNew->spr.ang = actor->spr.ang;
// vel // vel
@ -4650,9 +4638,7 @@ int move_actor(DSWActor* actor, int xchange, int ychange, int zchange)
if (labs(actor->spr.pos.Z - globloz) > actor->user.lo_step) if (labs(actor->spr.pos.Z - globloz) > actor->user.lo_step)
{ {
// cancel move // cancel move
actor->spr.pos.X = x; actor->set_int_pos({ x, y, z });
actor->spr.pos.Y = y;
actor->spr.pos.Z = z;
//actor->spr.z = actor->user.loz; // place on ground in case you are in the air //actor->spr.z = actor->user.loz; // place on ground in case you are in the air
actor->user.loz = loz; actor->user.loz = loz;
actor->user.hiz = hiz; actor->user.hiz = hiz;
@ -4668,9 +4654,7 @@ int move_actor(DSWActor* actor, int xchange, int ychange, int zchange)
if (ActorDrop(actor, actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z, actor->sector(), actor->user.lo_step)) if (ActorDrop(actor, actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z, actor->sector(), actor->user.lo_step))
{ {
// cancel move // cancel move
actor->spr.pos.X = x; actor->set_int_pos({ x, y, z });
actor->spr.pos.Y = y;
actor->spr.pos.Z = z;
//actor->spr.z = actor->user.loz; // place on ground in case you are in the air //actor->spr.z = actor->user.loz; // place on ground in case you are in the air
actor->user.loz = loz; actor->user.loz = loz;
actor->user.hiz = hiz; actor->user.hiz = hiz;

View file

@ -4479,10 +4479,7 @@ int DoFireballFlames(DSWActor* actor)
DSWActor* attach = actor->user.attachActor; DSWActor* attach = actor->user.attachActor;
if (attach != nullptr) if (attach != nullptr)
{ {
actor->spr.pos.X = attach->spr.pos.X; actor->set_int_pos({ attach->spr.pos.X, attach->spr.pos.Y, ActorZOfMiddle(attach) });
actor->spr.pos.Y = attach->spr.pos.Y;
actor->spr.pos.Z = ActorZOfMiddle(attach);
if ((attach->spr.extra & SPRX_BURNABLE)) if ((attach->spr.extra & SPRX_BURNABLE))
{ {
@ -8015,9 +8012,7 @@ int DoPlasma(DSWActor* actor)
if (hitActor->hasU() && hitActor != actor->user.WpnGoalActor) if (hitActor->hasU() && hitActor != actor->user.WpnGoalActor)
{ {
actor->spr.pos.X = ox; actor->set_int_pos({ ox, oy, oz });
actor->spr.pos.Y = oy;
actor->spr.pos.Z = oz;
hitActor->spr.cstat &= ~(CSTAT_SPRITE_BLOCK | CSTAT_SPRITE_BLOCK_HITSCAN); hitActor->spr.cstat &= ~(CSTAT_SPRITE_BLOCK | CSTAT_SPRITE_BLOCK_HITSCAN);
actor->user.coll = move_missile(actor, dax, day, daz, Z(16), Z(16), CLIPMASK_MISSILE, MISSILEMOVETICS); actor->user.coll = move_missile(actor, dax, day, daz, Z(16), Z(16), CLIPMASK_MISSILE, MISSILEMOVETICS);
@ -10785,9 +10780,7 @@ int DoNapalm(DSWActor* actor)
{ {
auto hcstat = hitActor->spr.cstat; auto hcstat = hitActor->spr.cstat;
actor->spr.pos.X = ox; actor->set_int_pos({ ox, oy, oz });
actor->spr.pos.Y = oy;
actor->spr.pos.Z = oz;
hitActor->spr.cstat &= ~(CSTAT_SPRITE_BLOCK | CSTAT_SPRITE_BLOCK_HITSCAN); hitActor->spr.cstat &= ~(CSTAT_SPRITE_BLOCK | CSTAT_SPRITE_BLOCK_HITSCAN);
actor->user.coll = move_missile(actor, actor->user.change.X, actor->user.change.Y, actor->user.change.Z, actor->user.ceiling_dist, actor->user.floor_dist, CLIPMASK_MISSILE, MISSILEMOVETICS); actor->user.coll = move_missile(actor, actor->user.change.X, actor->user.change.Y, actor->user.change.Z, actor->user.ceiling_dist, actor->user.floor_dist, CLIPMASK_MISSILE, MISSILEMOVETICS);
@ -10914,8 +10907,7 @@ int DoBloodWorm(DSWActor* actor)
GlobalSkipZrange = false; GlobalSkipZrange = false;
} }
actor->spr.pos.X = bx; actor->set_int_xy(bx, by);
actor->spr.pos.Y = by;
return false; return false;
} }
@ -10952,9 +10944,7 @@ int DoSerpMeteor(DSWActor* actor)
{ {
auto hcstat = hitActor->spr.cstat; auto hcstat = hitActor->spr.cstat;
actor->spr.pos.X = ox; actor->set_int_pos({ ox, oy, oz });
actor->spr.pos.Y = oy;
actor->spr.pos.Z = oz;
hitActor->spr.cstat &= ~(CSTAT_SPRITE_BLOCK | CSTAT_SPRITE_BLOCK_HITSCAN); hitActor->spr.cstat &= ~(CSTAT_SPRITE_BLOCK | CSTAT_SPRITE_BLOCK_HITSCAN);
actor->user.coll = move_missile(actor, actor->user.change.X, actor->user.change.Y, actor->user.change.Z, actor->user.ceiling_dist, actor->user.floor_dist, CLIPMASK_MISSILE, MISSILEMOVETICS); actor->user.coll = move_missile(actor, actor->user.change.X, actor->user.change.Y, actor->user.change.Z, actor->user.ceiling_dist, actor->user.floor_dist, CLIPMASK_MISSILE, MISSILEMOVETICS);
@ -11167,13 +11157,14 @@ int DoRing(DSWActor* actor)
} }
} }
int z;
// move the center with the player // move the center with the player
actor->spr.pos.X = own->spr.pos.X;
actor->spr.pos.Y = own->spr.pos.Y;
if (pp) if (pp)
actor->spr.pos.Z = pp->pos.Z + Z(20); z = pp->pos.Z + Z(20);
else else
actor->spr.pos.Z = ActorZOfMiddle(own) + Z(30); z = ActorZOfMiddle(own) + Z(30);
actor->set_int_pos({ own->spr.pos.X, own->spr.pos.Y, z });
// go out until its time to come back in // go out until its time to come back in
if (actor->user.Counter2 == false) if (actor->user.Counter2 == false)
@ -11305,13 +11296,13 @@ int DoSerpRing(DSWActor* actor)
return 0; return 0;
} }
// move the center with the player int z = actor->spr.pos.Z + actor->spr.zvel;
actor->spr.pos.X = own->spr.pos.X; if (z > own->spr.pos.Z - actor->user.pos.Z)
actor->spr.pos.Y = own->spr.pos.Y; z = own->spr.pos.Z - actor->user.pos.Z;
// move the center with the player
actor->set_int_pos({ own->spr.pos.X, own->spr.pos.Y, z });
actor->spr.pos.Z += actor->spr.zvel;
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 // go out until its time to come back in
if (actor->user.Counter2 == false) if (actor->user.Counter2 == false)
@ -15119,9 +15110,7 @@ DSWActor* SpawnWallHole(sectortype* hit_sect, walltype* hit_wall, int hit_x, int
actor->spr.extra = 0; actor->spr.extra = 0;
actor->spr.clipdist = 0; actor->spr.clipdist = 0;
actor->spr.xoffset = actor->spr.yoffset = 0; actor->spr.xoffset = actor->spr.yoffset = 0;
actor->spr.pos.X = hit_x; actor->set_int_pos({ hit_x, hit_y, hit_z });
actor->spr.pos.Y = hit_y;
actor->spr.pos.Z = hit_z;
actor->spr.picnum = 2151; actor->spr.picnum = 2151;
//actor->spr.cstat |= (CSTAT_SPRITE_TRANSLUCENT|CSTAT_SPRITE_ALIGNMENT_WALL); //actor->spr.cstat |= (CSTAT_SPRITE_TRANSLUCENT|CSTAT_SPRITE_ALIGNMENT_WALL);
@ -16952,8 +16941,7 @@ bool SpriteWarpToUnderwater(DSWActor* actor)
sy = overActor->spr.pos.Y - actor->spr.pos.Y; sy = overActor->spr.pos.Y - actor->spr.pos.Y;
// update to the new x y position // update to the new x y position
actor->spr.pos.X = underActor->spr.pos.X - sx; actor->set_int_xy(underActor->spr.pos.X - sx, underActor->spr.pos.Y - sy);
actor->spr.pos.Y = underActor->spr.pos.Y - sy;
auto over = overActor->sector(); auto over = overActor->sector();
auto under = underActor->sector(); auto under = underActor->sector();
@ -17026,8 +17014,7 @@ bool SpriteWarpToSurface(DSWActor* actor)
sy = underActor->spr.pos.Y - actor->spr.pos.Y; sy = underActor->spr.pos.Y - actor->spr.pos.Y;
// update to the new x y position // update to the new x y position
actor->spr.pos.X = overActor->spr.pos.X - sx; actor->set_int_xy(overActor->spr.pos.X - sx, overActor->spr.pos.Y - sy);
actor->spr.pos.Y = overActor->spr.pos.Y - sy;
auto over = overActor->sector(); auto over = overActor->sector();
auto under = underActor->sector(); auto under = underActor->sector();