From 50d80b5183a89e17cd0d68fce0bbeaaf3d6cb577 Mon Sep 17 00:00:00 2001 From: copperwater Date: Thu, 27 Feb 2025 17:08:31 -0500 Subject: [PATCH] Fix: map random y-placement used its width instead of height Not sure how long this has existed without triggering any issues, but when I was testing out a themed room wider than it was tall, I ran into rn2-of-a-negative-number impossibles. Traced it to here, where it was trying to subtract the width of the mapfrag from ROWNO to figure out which y-value it should place the map on. The correct behavior is to subtract the height of the mapfrag. --- src/sp_lev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sp_lev.c b/src/sp_lev.c index 66c6d2c87..73d349515 100644 --- a/src/sp_lev.c +++ b/src/sp_lev.c @@ -6133,7 +6133,7 @@ TODO: gc.coder->croom needs to be updated if (y < 1) y = 1; } else { - y = rn2(ROWNO - mf->wid); + y = rn2(ROWNO - mf->hei); } } }