Fix flipped objects having wrong slope roll angle

This commit is contained in:
indev committed 2024-01-06 03:13:49 +03:00
1 parent 7f78873a8a
commit 910e20b542
1 file changed
+3 -2
+3 -2
View File
@@ -3241,6 +3241,7 @@ void K_RollMobjBySlopes(mobj_t* mo, boolean usedistance)
I_Assert(mo->subsector->sector != NULL);
angle_t an;
boolean flip = mo->eflags & MFE_VERTICALFLIP;
fixed_t m_dist = R_PointToDist(mo->x, mo->y);
fixed_t rolldist = cv_sloperolldist.value * mapobjectscale;
@@ -3265,7 +3266,7 @@ void K_RollMobjBySlopes(mobj_t* mo, boolean usedistance)
else
mo->pitch_sprite = FixedAngle(0);
mo->slopepitch = mo->pitch_sprite;
mo->slopepitch = flip ? InvAngle(mo->pitch_sprite) : mo->pitch_sprite;
// roll
tempangle = (R_PointToAngle2(0, 0, tempz, tempy));
@@ -3279,7 +3280,7 @@ void K_RollMobjBySlopes(mobj_t* mo, boolean usedistance)
else
mo->roll_sprite = FixedAngle(0);
mo->sloperoll = mo->roll_sprite;
mo->sloperoll = flip ? InvAngle(mo->roll_sprite) : mo->roll_sprite;
}
else if (P_IsObjectOnGround(mo))
{