commit 941dd35fe01cb505def9a66c3038cde13b6a51f3
Author: Michael Francis <4574480+mfrancis95@users.noreply.github.com>
AuthorDate: Sun Apr 26 11:19:51 2026 -0400
Commit: GitHub <noreply@github.com>
CommitDate: Sun Apr 26 11:19:51 2026 -0400
Bump scrolling wall linedefs limit to 66 for gameversion <= 1.2 (#1764)
* Bump scrolling wall linedefs limit to 66 for gameversion <= 1.2
- Fix #1445.
- Add P_SpawnSpecials label to I_Error call.
- Dynamically display the vanilla limit based on gameversion in I_Error call instead of hardcoding it.
* src/doom/p_spec.c: Add parens to make `maxlineanims` assignment clear
---
src/doom/p_spec.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/src/doom/p_spec.c b/src/doom/p_spec.c
index 029f797f..8d890ce2 100644
--- a/src/doom/p_spec.c
+++ b/src/doom/p_spec.c
@@ -132,9 +132,13 @@ anim_t* lastanim;
// Animating line specials
//
#define MAXLINEANIMS 64
+// version <= 1.2 did not have a limit and could handle up to 66 scrolling
+// linedefs before displaying adverse effects. All other versions have a limit
+// of 64.
+#define MAXLINEANIMS1_2 66
short numlinespecials;
-line_t *linespeciallist[MAXLINEANIMS];
+line_t *linespeciallist[MAXLINEANIMS1_2];
@@ -1394,6 +1398,8 @@ void P_SpawnSpecials (void)
{
sector_t* sector;
int i;
+ short maxlineanims = (gameversion <= exe_doom_1_2) ? MAXLINEANIMS1_2
+ : MAXLINEANIMS;
// See if -TIMER was specified.
@@ -1484,10 +1490,11 @@ void P_SpawnSpecials (void)
switch(lines[i].special)
{
case 48:
- if (numlinespecials >= MAXLINEANIMS)
+ if (numlinespecials >= maxlineanims)
{
- I_Error("Too many scrolling wall linedefs (%d)! "
- "(Vanilla limit is 64)", NumScrollers());
+ I_Error("P_SpawnSpecials: Too many scrolling wall linedefs "
+ "(%d)! (Vanilla limit is %d)", NumScrollers(),
+ maxlineanims);
}
// EFFECT FIRSTCOL SCROLL+
linespeciallist[numlinespecials] = &lines[i];