diff --git a/src/r_patchrotation.c b/src/r_patchrotation.c
index 83eb4eeba0e2af34f76f18fb5a7d964e513b7d1d..803e159ef5cb24b04ba5bd79f7f74b4588409b7f 100644
--- a/src/r_patchrotation.c
+++ b/src/r_patchrotation.c
@@ -127,17 +127,15 @@ void RotatedPatch_DoRotation(rotsprite_t *rotsprite, patch_t *patch, INT32 angle
 #define ROTSPRITE_YCENTER (newheight / 2)
 
 	if (flip)
-		idx += rotsprite->angles;
-
-	if (rotsprite->patches[idx])
-		return;
-
-	if (bflip)
 	{
+		idx += rotsprite->angles;
 		xpivot = width - xpivot;
 		leftoffset = width - leftoffset;
 	}
 
+	if (rotsprite->patches[idx])
+		return;
+
 	// Find the dimensions of the rotated patch.
 	{
 		INT32 w1 = abs(FixedMul(width << FRACBITS, ca) - FixedMul(height << FRACBITS, sa));
@@ -226,7 +224,7 @@ void RotatedPatch_DoRotation(rotsprite_t *rotsprite, patch_t *patch, INT32 angle
 	rotated = (patch_t *)Picture_Convert(PICFMT_FLAT16, rawdst, PICFMT_PATCH, 0, &size, newwidth, newheight, 0, 0, 0);
 
 	Z_ChangeTag(rotated, PU_PATCH_ROTATED);
-	Z_SetUser(rotated, (void **)(&rotsprite->patches[angle]));
+	Z_SetUser(rotated, (void **)(&rotsprite->patches[idx]));
 
 	rotated->leftoffset = (rotated->width / 2) + (leftoffset - xpivot);
 	rotated->topoffset = (rotated->height / 2) + (patch->topoffset - ypivot);