diff --git a/source/games/duke/src/actors.cpp b/source/games/duke/src/actors.cpp index 0c4b0578f..f67447090 100644 --- a/source/games/duke/src/actors.cpp +++ b/source/games/duke/src/actors.cpp @@ -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); } } } diff --git a/source/games/duke/src/actors_d.cpp b/source/games/duke/src/actors_d.cpp index 9a2154018..fe88b7778 100644 --- a/source/games/duke/src/actors_d.cpp +++ b/source/games/duke/src/actors_d.cpp @@ -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; diff --git a/source/games/duke/src/actors_r.cpp b/source/games/duke/src/actors_r.cpp index cb00b184b..2c3344d74 100644 --- a/source/games/duke/src/actors_r.cpp +++ b/source/games/duke/src/actors_r.cpp @@ -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; } } diff --git a/source/games/duke/src/player.cpp b/source/games/duke/src/player.cpp index 331b5aa35..bd000aaf6 100644 --- a/source/games/duke/src/player.cpp +++ b/source/games/duke/src/player.cpp @@ -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)) diff --git a/source/games/duke/src/spawn.cpp b/source/games/duke/src/spawn.cpp index 086858a1d..1559565b0 100644 --- a/source/games/duke/src/spawn.cpp +++ b/source/games/duke/src/spawn.cpp @@ -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);