- Duke: full pos assignments

This commit is contained in:
Christoph Oelckers 2022-01-31 19:21:11 +01:00
parent b9568aa372
commit f629ec1916
5 changed files with 11 additions and 7 deletions

View file

@ -1363,7 +1363,7 @@ void rpgexplode(DDukeActor *actor, int hit, const vec3_t &pos, int EXPLOSION2, i
{
auto explosion = spawn(actor, EXPLOSION2);
if (!explosion) return;
explosion->spr.pos = pos;
explosion->set_int_pos(pos);
if (actor->spr.xrepeat < 10)
{
@ -2699,7 +2699,7 @@ void handle_se00(DDukeActor* actor)
auto psp = ps[p].GetActor();
if (psp->spr.extra <= 0)
{
psp->spr.pos.vec2 = res;
psp->set_int_xy(res.X, res.Y);
}
}
}

View file

@ -1320,7 +1320,7 @@ static bool movefireball(DDukeActor* actor)
if (trail)
{
FireProj* proj = &trail->fproj;
ball->spr.pos = proj->pos;
ball->set_int_pos(proj->pos);
ball->spr.xvel = proj->vel.X;
ball->spr.yvel = proj->vel.Y;
ball->spr.zvel = proj->vel.Z;

View file

@ -976,7 +976,9 @@ static bool weaponhitsprite(DDukeActor *proj, DDukeActor *targ, const vec3_t &ol
&& targ->spr.pal == 19)
{
S_PlayActorSound(RPG_EXPLODE, proj);
spawn(proj, EXPLOSION2)->spr.pos = oldpos;
auto spawned = spawn(proj, EXPLOSION2);
if (spawned)
spawned->set_int_pos( oldpos);
return true;
}
}

View file

@ -174,7 +174,8 @@ int hits(DDukeActor* actor)
if (actor->isPlayer()) zoff = isRR() ? PHEIGHT_RR : PHEIGHT_DUKE;
else zoff = 0;
hitscan(actor->spr.pos.withZOffset(-zoff), actor->sector(), { bcos(actor->spr.ang), bsin(actor->spr.ang), 0 }, hit, CLIPMASK1);
auto pos = actor->spr.pos;
hitscan(pos.withZOffset(-zoff), actor->sector(), { bcos(actor->spr.ang), bsin(actor->spr.ang), 0 }, hit, CLIPMASK1);
return (FindDistance2D(hit.hitpos.vec2 - actor->spr.pos.vec2));
}
@ -194,7 +195,8 @@ int hitasprite(DDukeActor* actor, DDukeActor** hitsp)
else if (actor->spr.picnum == TILE_APLAYER) zoff = isRR() ? PHEIGHT_RR : PHEIGHT_DUKE;
else zoff = 0;
hitscan(actor->spr.pos.withZOffset(-zoff), actor->sector(), { bcos(actor->spr.ang), bsin(actor->spr.ang), 0 }, hit, CLIPMASK1);
auto pos = actor->spr.pos;
hitscan(pos.withZOffset(-zoff), actor->sector(), { bcos(actor->spr.ang), bsin(actor->spr.ang), 0 }, hit, CLIPMASK1);
if (hitsp) *hitsp = hit.actor();
if (hit.hitWall != nullptr && (hit.hitWall->cstat & CSTAT_WALL_MASKED) && badguy(actor))

View file

@ -498,7 +498,7 @@ void initcrane(DDukeActor* actj, DDukeActor* act, int CRANEPOLE)
apt.pole.X = actk->spr.pos.X;
apt.pole.Y = actk->spr.pos.Y;
actk->spr.pos = act->spr.pos;
actk->set_int_pos(act->spr.pos);
actk->spr.shade = act->spr.shade;
SetActor(actk, actk->spr.pos);