diff --git a/source/core/actorlist.cpp b/source/core/actorlist.cpp index b10218029..645f5955d 100644 --- a/source/core/actorlist.cpp +++ b/source/core/actorlist.cpp @@ -447,21 +447,21 @@ void InitSpriteLists() // //========================================================================== -void SetActor(DCoreActor* actor, const vec3_t* newpos) +void SetActor(DCoreActor* actor, const DVector3& newpos) { auto tempsector = actor->sector(); - actor->set_int_pos(*newpos); - updatesector(newpos->X, newpos->Y, &tempsector); + actor->spr.pos = newpos; + updatesector(newpos, &tempsector); if (tempsector && tempsector != actor->sector()) ChangeActorSect(actor, tempsector); } -void SetActorZ(DCoreActor* actor, const vec3_t* newpos) +void SetActorZ(DCoreActor* actor, const DVector3& newpos) { auto tempsector = actor->sector(); - actor->set_int_pos(*newpos); - updatesectorz(newpos->X, newpos->Y, newpos->Z, &tempsector); + actor->spr.pos = newpos; + updatesectorz(newpos, &tempsector); if (tempsector && tempsector != actor->sector()) ChangeActorSect(actor, tempsector); diff --git a/source/core/coreactor.h b/source/core/coreactor.h index 1f212da4c..97ec71603 100644 --- a/source/core/coreactor.h +++ b/source/core/coreactor.h @@ -530,24 +530,19 @@ int ChangeActorStat(DCoreActor* actor, int nStatus, bool forcetail = false); void InitSpriteLists(); -void SetActorZ(DCoreActor* actor, const vec3_t* newpos); -void SetActor(DCoreActor* actor, const vec3_t* newpos); +void SetActorZ(DCoreActor* actor, const DVector3& newpos); +void SetActor(DCoreActor* actor, const DVector3& newpos); -inline void SetActorZ(DCoreActor* actor, const vec3_t& newpos) +inline void SetActor(DCoreActor* actor, const vec3_t* newpos) { - SetActorZ(actor, &newpos); + DVector3 ipos = { newpos->X * inttoworld, newpos->Y * inttoworld, newpos->Z * zinttoworld }; + SetActor(actor, ipos); } -inline void SetActor(DCoreActor* actor, const DVector3& newpos) +inline void SetActorZ(DCoreActor* actor, const vec3_t* newpos) { - vec3_t ipos = { int(newpos.X * worldtoint), int(newpos.Y * worldtoint), int(newpos.Z * zworldtoint) }; - SetActor(actor, &ipos); -} - -inline void SetActorZ(DCoreActor* actor, const DVector3& newpos) -{ - vec3_t ipos = { int(newpos.X * worldtoint), int(newpos.Y * worldtoint), int(newpos.Z * zworldtoint) }; - SetActorZ(actor, &ipos); + DVector3 ipos = { newpos->X * inttoworld, newpos->Y * inttoworld, newpos->Z * zinttoworld }; + SetActorZ(actor, ipos); } inline int clipmove(vec3_t& pos, sectortype** const sect, int xvect, int yvect,