From fe8c1d133112a55ab98c61b531779299f035f4c3 Mon Sep 17 00:00:00 2001
From: MascaraSnake <jonassauer27@gmail.com>
Date: Tue, 21 Dec 2021 22:00:42 +0100
Subject: [PATCH] Adapt Pyre Fly to UDMF

---
 extras/conf/udb/Includes/SRB222_things.cfg | 6 ++++++
 src/p_mobj.c                               | 4 ++--
 src/p_setup.c                              | 3 +++
 3 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/extras/conf/udb/Includes/SRB222_things.cfg b/extras/conf/udb/Includes/SRB222_things.cfg
index d5af8fb90..e5bec6d3a 100644
--- a/extras/conf/udb/Includes/SRB222_things.cfg
+++ b/extras/conf/udb/Includes/SRB222_things.cfg
@@ -3764,6 +3764,12 @@ udmf
 			sprite = "PYREA0";
 			width = 24;
 			height = 34;
+			arg0
+			{
+				title = "Start on fire?";
+				type = 11;
+				enum = "noyes";
+			}
 		}
 		137
 		{
diff --git a/src/p_mobj.c b/src/p_mobj.c
index 0652967d7..7c44ae8da 100644
--- a/src/p_mobj.c
+++ b/src/p_mobj.c
@@ -12924,8 +12924,8 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj, boolean
 		}
 		break;
 	case MT_PYREFLY:
-		//start on fire if Ambush flag is set, otherwise behave normally
-		if (mthing->options & MTF_AMBUSH)
+		//start on fire if args[0], otherwise behave normally
+		if (mthing->args[0])
 		{
 			P_SetMobjState(mobj, mobj->info->meleestate);
 			mobj->extravalue2 = 2;
diff --git a/src/p_setup.c b/src/p_setup.c
index 9ef539110..03a7cf564 100644
--- a/src/p_setup.c
+++ b/src/p_setup.c
@@ -4896,6 +4896,9 @@ static void P_ConvertBinaryMap(void)
 		case 135: //Pterabyte Spawner
 			mapthings[i].args[0] = mapthings[i].extrainfo + 1;
 			break;
+		case 136: //Pyre Fly
+			mapthings[i].args[0] = !!(mapthings[i].options & MTF_AMBUSH);
+			break;
 		case 502: //Star post
 			if (mapthings[i].extrainfo)
 				// Allow thing Parameter to define star post num too!
-- 
GitLab