diff --git a/source/core/coreactor.h b/source/core/coreactor.h index 354dc0254..1f212da4c 100644 --- a/source/core/coreactor.h +++ b/source/core/coreactor.h @@ -533,11 +533,6 @@ void InitSpriteLists(); void SetActorZ(DCoreActor* actor, const vec3_t* newpos); void SetActor(DCoreActor* actor, const vec3_t* newpos); -inline void SetActor(DCoreActor* actor, const vec3_t& newpos) -{ - SetActor(actor, &newpos); -} - inline void SetActorZ(DCoreActor* actor, const vec3_t& newpos) { SetActorZ(actor, &newpos); diff --git a/source/games/blood/src/gameutil.cpp b/source/games/blood/src/gameutil.cpp index 657ee82b3..71fc4198e 100644 --- a/source/games/blood/src/gameutil.cpp +++ b/source/games/blood/src/gameutil.cpp @@ -86,7 +86,9 @@ bool CheckProximityPoint(int nX1, int nY1, int nZ1, int nX2, int nY2, int nZ2, i //--------------------------------------------------------------------------- // -// +// Note: This function features some very bad math. +// It cannot be redone because some game functionality +// depends on the math being broken. // //--------------------------------------------------------------------------- diff --git a/source/games/blood/src/gameutil.h b/source/games/blood/src/gameutil.h index 59e56f8a2..364e64b0b 100644 --- a/source/games/blood/src/gameutil.h +++ b/source/games/blood/src/gameutil.h @@ -34,7 +34,6 @@ enum { bool CheckProximity(DBloodActor* pSprite, const DVector3& pos, sectortype* pSector, int nDist); bool CheckProximityPoint(int nX1, int nY1, int nZ1, int nX2, int nY2, int nZ2, int nDist); -bool CheckProximityWall(walltype* pWall, int x, int y, int nDist); int GetWallAngle(walltype* pWall); void GetWallNormal(walltype* pWall, int* pX, int* pY); bool IntersectRay(int wx, int wy, int wdx, int wdy, int x1, int y1, int z1, int x2, int y2, int z2, int* ix, int* iy, int* iz); diff --git a/source/games/duke/src/actors_d.cpp b/source/games/duke/src/actors_d.cpp index b17e1cd63..ae93e4b44 100644 --- a/source/games/duke/src/actors_d.cpp +++ b/source/games/duke/src/actors_d.cpp @@ -1424,7 +1424,7 @@ static bool weaponhitwall(DDukeActor *proj, walltype* wal, const vec3_t &oldpos) } else { - SetActor(proj, oldpos); + SetActor(proj, &oldpos); fi.checkhitwall(proj, wal, proj->int_pos().X, proj->int_pos().Y, proj->int_pos().Z, proj->spr.picnum); if (proj->spr.picnum == FREEZEBLAST) @@ -1451,7 +1451,7 @@ static bool weaponhitwall(DDukeActor *proj, walltype* wal, const vec3_t &oldpos) static bool weaponhitsector(DDukeActor* proj, const vec3_t& oldpos, bool fireball) { - SetActor(proj, oldpos); + SetActor(proj, &oldpos); if (proj->spr.zvel < 0) { @@ -2458,9 +2458,7 @@ static void flamethrowerflame(DDukeActor *actor) return; } - int dax = actor->int_pos().X; - int day = actor->int_pos().Y; - int daz = actor->int_pos().Z; + auto dapos = actor->spr.pos; int xvel = actor->spr.xvel; getglobalz(actor); @@ -2514,12 +2512,12 @@ static void flamethrowerflame(DDukeActor *actor) } else if (coll.type == kHitWall) { - SetActor(actor, vec3_t( dax, day, daz )); + SetActor(actor, dapos); fi.checkhitwall(actor, coll.hitWall, actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z, actor->spr.picnum); } else if (coll.type == kHitSector) { - SetActor(actor, vec3_t(dax, day, daz)); + SetActor(actor, dapos); if (actor->spr.zvel < 0) fi.checkhitceiling(actor->sector()); } diff --git a/source/games/duke/src/actors_r.cpp b/source/games/duke/src/actors_r.cpp index d99c4445e..50d31e086 100644 --- a/source/games/duke/src/actors_r.cpp +++ b/source/games/duke/src/actors_r.cpp @@ -1059,7 +1059,7 @@ static bool weaponhitwall(DDukeActor *proj, walltype* wal, const vec3_t& oldpos) } else { - SetActor(proj, oldpos); + SetActor(proj, &oldpos); fi.checkhitwall(proj, wal, proj->int_pos().X, proj->int_pos().Y, proj->int_pos().Z, proj->spr.picnum); if (!isRRRA() && proj->spr.picnum == FREEZEBLAST) @@ -1126,7 +1126,7 @@ static bool weaponhitwall(DDukeActor *proj, walltype* wal, const vec3_t& oldpos) bool weaponhitsector(DDukeActor *proj, const vec3_t& oldpos) { - SetActor(proj, oldpos); + SetActor(proj, &oldpos); if (isRRRA() && proj->GetOwner() && proj->GetOwner()->spr.picnum == MAMA) {