From cada0d2928838e0309e10d1dbf9a787e68f2f7e9 Mon Sep 17 00:00:00 2001
From: MascaraSnake <jonassauer27@gmail.com>
Date: Fri, 1 May 2020 19:29:19 +0200
Subject: [PATCH] Implement "add airbob thinker to FOF" linedef type

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

diff --git a/extras/conf/udb/Includes/SRB222_linedefs.cfg b/extras/conf/udb/Includes/SRB222_linedefs.cfg
index a356a2df75..9b520a56ed 100644
--- a/extras/conf/udb/Includes/SRB222_linedefs.cfg
+++ b/extras/conf/udb/Includes/SRB222_linedefs.cfg
@@ -1941,6 +1941,32 @@ udmf
 				enum = "noyes";
 			}
 		}
+
+		261
+		{
+			title = "Add Air Bobbing Thinker";
+			prefix = "(261)";
+			arg0
+			{
+				title = "Control linedef tag";
+				type = 15;
+			}
+			arg1
+			{
+				title = "Bobbing distance";
+			}
+			arg2
+			{
+				title = "Flags";
+				type = 12;
+				enum
+				{
+					1 = "Raise";
+					2 = "Require spindash";
+					4 = "Dynamic";
+				}
+			}
+		}
 	}
 
 	linedefexecmisc
diff --git a/src/p_spec.c b/src/p_spec.c
index 128f84a73f..3b86857d29 100644
--- a/src/p_spec.c
+++ b/src/p_spec.c
@@ -6989,6 +6989,19 @@ void P_SpawnSpecials(boolean fromnetsave)
 				}
 				break;
 
+			case 261: // Add air bob 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_AddAirbob(lines[l].frontsector, lines[l].args[0], lines[i].args[1] << FRACBITS, !!(lines[i].args[2] & TMFB_REVERSE), !!(lines[i].args[2] & TMFB_SPINDASH), !!(lines[i].args[2] & TMFB_DYNAMIC));
+					}
+				}
+				break;
+
 			case 300: // Linedef executor (combines with sector special 974/975) and commands
 			case 302:
 			case 303:
-- 
GitLab