From d34077a3ba50b0953c02ec67c30257fb6ca664a3 Mon Sep 17 00:00:00 2001
From: Christoph Oelckers <c.oelckers@zdoom.fake>
Date: Wed, 6 Jan 2016 02:05:39 +0100
Subject: [PATCH] - ... and finally the push flag.

---
 src/p_lnspec.h  | 2 --
 src/p_saveg.cpp | 6 +++++-
 src/p_spec.cpp  | 8 ++++++--
 src/r_defs.h    | 1 +
 4 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/src/p_lnspec.h b/src/p_lnspec.h
index cb3f6bf85..9fb4c17b3 100644
--- a/src/p_lnspec.h
+++ b/src/p_lnspec.h
@@ -176,12 +176,10 @@ typedef enum {
 
 // [RH] Equivalents for BOOM's generalized sector types
 
-#ifndef SECRET_MASK
 #define DAMAGE_MASK		0x0300
 #define SECRET_MASK		0x0400
 #define FRICTION_MASK	0x0800
 #define PUSH_MASK		0x1000
-#endif
 
 struct line_t;
 class AActor;
diff --git a/src/p_saveg.cpp b/src/p_saveg.cpp
index 16109891b..2547933bc 100644
--- a/src/p_saveg.cpp
+++ b/src/p_saveg.cpp
@@ -418,7 +418,11 @@ void P_SerializeWorld (FArchive &arc)
 			{
 				sec->Flags |= SECF_FRICTION;
 			}
-			sec->special &= ~(SECRET_MASK|FRICTION_MASK);
+			if (sec->special & PUSH_MASK)
+			{
+				sec->Flags |= SECF_PUSH;
+			}
+			sec->special &= ~(SECRET_MASK|FRICTION_MASK|PUSH_MASK);
 		}
 		arc	<< sec->interpolations[0]
 			<< sec->interpolations[1]
diff --git a/src/p_spec.cpp b/src/p_spec.cpp
index a5bdfffd4..493e3e157 100644
--- a/src/p_spec.cpp
+++ b/src/p_spec.cpp
@@ -1197,7 +1197,11 @@ void P_SpawnSpecials (void)
 		{
 			sector->Flags |= SECF_FRICTION;
 		}
-		sector->special &= ~(SECRET_MASK|FRICTION_MASK);
+		if (sector->special & PUSH_MASK)
+		{
+			sector->Flags |= SECF_PUSH;
+		}
+		sector->special &= ~(SECRET_MASK|FRICTION_MASK|PUSH_MASK);
 
 		switch (sector->special & 0xff)
 		{
@@ -2184,7 +2188,7 @@ void DPusher::Tick ()
 	// Be sure the special sector type is still turned on. If so, proceed.
 	// Else, bail out; the sector type has been changed on us.
 
-	if (!(sec->special & PUSH_MASK))
+	if (!(sec->Flags & SECF_PUSH))
 		return;
 
 	// For constant pushers (wind/current) there are 3 situations:
diff --git a/src/r_defs.h b/src/r_defs.h
index 014fa1b32..d5321a0c3 100644
--- a/src/r_defs.h
+++ b/src/r_defs.h
@@ -356,6 +356,7 @@ enum
 	SECF_FLOORDROP		= 4,	// all actors standing on this floor will remain on it when it lowers very fast.
 	SECF_NORESPAWN		= 8,	// players can not respawn in this sector
 	SECF_FRICTION		= 16,	// sector has friction enabled
+	SECF_PUSH			= 32,	// pushers enabled
 
 
 	SECF_WASSECRET		= 1 << 30,	// a secret that was discovered