From 159307c552a66266c4a2f533baca192b94b801e7 Mon Sep 17 00:00:00 2001
From: Lactozilla <jp6781615@gmail.com>
Date: Mon, 8 Jan 2024 22:03:31 -0300
Subject: [PATCH] Fix 3D floor side texture scale when there are multiple on
 the same line

---
 src/r_segs.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/r_segs.c b/src/r_segs.c
index 62fea352fc..16d6a18562 100644
--- a/src/r_segs.c
+++ b/src/r_segs.c
@@ -525,6 +525,9 @@ static boolean R_IsFFloorTranslucent(visffloor_t *pfloor)
 //
 // R_RenderThickSideRange
 // Renders all the thick sides in the given range.
+
+static fixed_t ffloortexturecolumn[MAXVIDWIDTH];
+
 void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
 {
 	size_t          pindex;
@@ -732,10 +735,10 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
 	wall_scalex = FixedDiv(FRACUNIT, sidedef->scalex_mid);
 	wall_scaley = sidedef->scaley_mid;
 
-	thicksidecol = ds->thicksidecol;
+	thicksidecol = ffloortexturecolumn;
 
 	for (INT32 x = x1; x <= x2; x++)
-		thicksidecol[x] = FixedDiv(thicksidecol[x], wall_scalex) + ds->offsetx;
+		thicksidecol[x] = FixedDiv(ds->thicksidecol[x], wall_scalex) + ds->offsetx;
 
 	mfloorclip = ds->sprbottomclip;
 	mceilingclip = ds->sprtopclip;
-- 
GitLab