From bc52bc83ccd2020d3ebb67f6d7a8e525857b4e11 Mon Sep 17 00:00:00 2001
From: Steel Titanium <steeltitanium1@gmail.com>
Date: Fri, 6 Sep 2019 20:51:39 -0400
Subject: [PATCH] 2D toggle command

---
 src/d_netcmd.c |  1 +
 src/m_cheat.c  | 12 ++++++++++++
 src/m_cheat.h  |  1 +
 3 files changed, 14 insertions(+)

diff --git a/src/d_netcmd.c b/src/d_netcmd.c
index 3e82fc60c5..590543f007 100644
--- a/src/d_netcmd.c
+++ b/src/d_netcmd.c
@@ -849,6 +849,7 @@ void D_RegisterClientCommands(void)
 	COM_AddCommand("rteleport", Command_RTeleport_f);
 	COM_AddCommand("skynum", Command_Skynum_f);
 	COM_AddCommand("weather", Command_Weather_f);
+	COM_AddCommand("toggletwod", Command_Toggletwod_f);
 #ifdef _DEBUG
 	COM_AddCommand("causecfail", Command_CauseCfail_f);
 #endif
diff --git a/src/m_cheat.c b/src/m_cheat.c
index 29e8c8a023..da449b2f7a 100644
--- a/src/m_cheat.c
+++ b/src/m_cheat.c
@@ -746,6 +746,18 @@ void Command_Weather_f(void)
 	P_SwitchWeather(atoi(COM_Argv(1)));
 }
 
+void Command_Toggletwod_f(void)
+{
+	player_t *p = &players[consoleplayer];
+
+	REQUIRE_DEVMODE;
+	REQUIRE_INLEVEL;
+	REQUIRE_SINGLEPLAYER;
+
+	if (p->mo)
+		p->mo->flags2 ^= MF2_TWOD;
+}
+
 #ifdef _DEBUG
 // You never thought you needed this, did you? >=D
 // Yes, this has the specific purpose of completely screwing you up
diff --git a/src/m_cheat.h b/src/m_cheat.h
index aa9b0bfebb..f5d59120b5 100644
--- a/src/m_cheat.h
+++ b/src/m_cheat.h
@@ -64,6 +64,7 @@ void Command_Teleport_f(void);
 void Command_RTeleport_f(void);
 void Command_Skynum_f(void);
 void Command_Weather_f(void);
+void Command_Toggletwod_f(void);
 #ifdef _DEBUG
 void Command_CauseCfail_f(void);
 #endif
-- 
GitLab