From 312a2def3d8a2cc84f38dc298007feacd9888b1f Mon Sep 17 00:00:00 2001
From: MascaraSnake <jonassauer27@gmail.com>
Date: Sat, 2 May 2020 10:30:21 +0200
Subject: [PATCH] Implement "add laser thinker to FOF" linedef type

---
 extras/conf/udb/Includes/SRB222_linedefs.cfg | 17 +++++++++++++++++
 src/p_spec.c                                 | 13 +++++++++++++
 2 files changed, 30 insertions(+)

diff --git a/extras/conf/udb/Includes/SRB222_linedefs.cfg b/extras/conf/udb/Includes/SRB222_linedefs.cfg
index 8c093052fa..87ef6db338 100644
--- a/extras/conf/udb/Includes/SRB222_linedefs.cfg
+++ b/extras/conf/udb/Includes/SRB222_linedefs.cfg
@@ -1991,6 +1991,23 @@ udmf
 				type = 2;
 			}
 		}
+
+		263
+		{
+			title = "Add Laser Thinker";
+			prefix = "(263)";
+			arg0
+			{
+				title = "Control linedef tag";
+				type = 15;
+			}
+			arg1
+			{
+				title = "Damage bosses?";
+				type = 11;
+				enum = "yesno";
+			}
+		}
 	}
 
 	linedefexecmisc
diff --git a/src/p_spec.c b/src/p_spec.c
index a207b0fad4..e5e50d73ef 100644
--- a/src/p_spec.c
+++ b/src/p_spec.c
@@ -6999,6 +6999,19 @@ void P_SpawnSpecials(boolean fromnetsave)
 				}
 				break;
 
+			case 263: // Add laser thinker to FOF
+				if (udmf)
+				{
+					for (l = -1; (l = P_FindLineFromTag(lines[i].args[0], l)) >= 0 ;)
+					{
+						if (lines[l].special < 100 || lines[l].special >= 300)
+							continue;
+
+						P_AddLaserThinker(lines[l].args[0], lines + l, !!(lines[i].args[1]));
+					}
+				}
+				break;
+
 			case 300: // Linedef executor (combines with sector special 974/975) and commands
 			case 302:
 			case 303:
-- 
GitLab