diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c
index 5f957ccc2f55d03751b34c0c5d4cf2f67d356515..09f1d44d50be38158b7c25394b21bb78cd979341 100644
--- a/src/hardware/hw_main.c
+++ b/src/hardware/hw_main.c
@@ -1788,7 +1788,7 @@ static void HWR_RenderExtraTexture(unsigned which, side_t *side, sector_t *sec_f
 
 static void HWR_RenderFFloorExtraTextures(ffloor_t *pfloor, v2d_t vs, v2d_t ve, float xcliplow, float xcliphigh, boolean use_3dfloor_blend, FSurfaceInfo Surf, FBITFIELD blendmode)
 {
-	side_t *pside = R_GetFFloorSide(gl_curline, pfloor);
+	side_t *pside = R_GetFFloorSide(gl_curline->linedef, pfloor, pfloor->target);
 	sector_t *psector = pfloor->master->frontsector;
 
 	if (use_3dfloor_blend)
diff --git a/src/p_maputl.c b/src/p_maputl.c
index da2b99b5b0d89ce89268b6245a2976a729910963..200b89cff93c815bac281c8b270ae4975de219c6 100644
--- a/src/p_maputl.c
+++ b/src/p_maputl.c
@@ -498,7 +498,6 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
 			fixed_t textop, texbottom, texheight;
 			fixed_t texmid, delta1, delta2;
 			INT32 texnum = R_GetTextureNum(side->midtexture); // make sure the texture is actually valid
-			boolean wrapmidtex = linedef->flags & ML_WRAPMIDTEX || side->flags & SIDEFLAG_WRAP_MIDTEX;
 
 			if (texnum) {
 				fixed_t scaley = abs(side->scaley_mid);
diff --git a/src/r_things.c b/src/r_things.c
index b8011ed6877b6c9de219e9eaf877b3015fb49aed..24d77e9c902d1071a2440245a739046d28a27637 100644
--- a/src/r_things.c
+++ b/src/r_things.c
@@ -2948,7 +2948,7 @@ static fixed_t R_GetLowestSidedefTexture(side_t *side)
 
 static fixed_t R_GetFFloorTopZAt(const drawseg_t *ds, const ffloor_t *pfloor, fixed_t x, fixed_t y)
 {
-	side_t *side = R_GetFFloorSide(ds->curline, pfloor);
+	side_t *side = R_GetFFloorSide(ds->curline->linedef, pfloor, pfloor->target);
 	if (side->flags & SIDEFLAG_HASEDGETEXTURES)
 		return P_GetFFloorTopZAt(pfloor, x, y) + R_GetHighestSidedefTexture(side);
 
@@ -2957,7 +2957,7 @@ static fixed_t R_GetFFloorTopZAt(const drawseg_t *ds, const ffloor_t *pfloor, fi
 
 static fixed_t R_GetFFloorBottomZAt(const drawseg_t *ds, const ffloor_t *pfloor, fixed_t x, fixed_t y)
 {
-	side_t *side = R_GetFFloorSide(ds->curline, pfloor);
+	side_t *side = R_GetFFloorSide(ds->curline->linedef, pfloor, pfloor->target);
 	if (side->flags & SIDEFLAG_HASEDGETEXTURES)
 		return P_GetFFloorBottomZAt(pfloor, x, y) - R_GetLowestSidedefTexture(side);