diff --git a/src/actor.h b/src/actor.h index 25caaaedec..8f38e6e8cb 100644 --- a/src/actor.h +++ b/src/actor.h @@ -893,7 +893,7 @@ public: fixedvec2 ret = { X() + dx, Y() + dy }; return ret; } - else return P_GetOffsetPosition(this, dx, dy); + else return P_GetOffsetPosition(X(), Y(), dx, dy); } @@ -905,7 +905,7 @@ public: Y() + FixedMul(length, finesine[angle >> ANGLETOFINESHIFT]) }; return ret; } - else return P_GetOffsetPosition(this, FixedMul(length, finecosine[angle >> ANGLETOFINESHIFT]), FixedMul(length, finesine[angle >> ANGLETOFINESHIFT])); + else return P_GetOffsetPosition(X(), Y(), FixedMul(length, finecosine[angle >> ANGLETOFINESHIFT]), FixedMul(length, finesine[angle >> ANGLETOFINESHIFT])); } fixedvec3 Vec3Offset(fixed_t dx, fixed_t dy, fixed_t dz, bool absolute = false) @@ -917,7 +917,7 @@ public: } else { - fixedvec2 op = P_GetOffsetPosition(this, dx, dy); + fixedvec2 op = P_GetOffsetPosition(X(), Y(), dx, dy); fixedvec3 pos = { op.x, op.y, Z() + dz }; return pos; } @@ -933,7 +933,7 @@ public: } else { - fixedvec2 op = P_GetOffsetPosition(this, FixedMul(length, finecosine[angle >> ANGLETOFINESHIFT]), FixedMul(length, finesine[angle >> ANGLETOFINESHIFT])); + fixedvec2 op = P_GetOffsetPosition(X(), Y(), FixedMul(length, finecosine[angle >> ANGLETOFINESHIFT]), FixedMul(length, finesine[angle >> ANGLETOFINESHIFT])); fixedvec3 pos = { op.x, op.y, Z() + dz }; return pos; } diff --git a/src/portal.cpp b/src/portal.cpp index 92d7534074..8cf4bf546d 100644 --- a/src/portal.cpp +++ b/src/portal.cpp @@ -701,12 +701,12 @@ void P_NormalizeVXVY(fixed_t& vx, fixed_t& vy) // //============================================================================ -fixedvec2 P_GetOffsetPosition(AActor *actor, fixed_t dx, fixed_t dy) +fixedvec2 P_GetOffsetPosition(fixed_t x, fixed_t y, fixed_t dx, fixed_t dy) { - fixedvec2 dest = { actor->X() + dx, actor->Y() + dy }; + fixedvec2 dest = { x + dx, y + dy }; if (PortalBlockmap.containsLines) { - fixed_t actx = actor->X(), acty = actor->Y(); + fixed_t actx = x, acty = y; // Try some easily discoverable early-out first. If we know that the trace cannot possibly find a portal, this saves us from calling the traverser completely for vast parts of the map. if (dx < 128 * FRACUNIT && dy < 128 * FRACUNIT) { diff --git a/src/portal.h b/src/portal.h index ef8cec98af..127a9ec3ba 100644 --- a/src/portal.h +++ b/src/portal.h @@ -198,6 +198,6 @@ void P_TranslatePortalAngle(line_t* src, line_t* dst, angle_t& angle); void P_TranslatePortalZ(line_t* src, line_t* dst, fixed_t& z); void P_NormalizeVXVY(fixed_t& vx, fixed_t& vy); fixed_t P_PointLineDistance(line_t* line, fixed_t x, fixed_t y); -fixedvec2 P_GetOffsetPosition(AActor *actor, fixed_t dx, fixed_t dy); +fixedvec2 P_GetOffsetPosition(fixed_t x, fixed_t y, fixed_t dx, fixed_t dy); #endif \ No newline at end of file