From a1554799d945b2647c89f157472d013fa5be775e Mon Sep 17 00:00:00 2001
From: Randy Heit <rheit@zdoom.fake>
Date: Fri, 7 Aug 2009 03:41:23 +0000
Subject: [PATCH] - Added MF6_NOTELEPORT flag.

SVN r1754 (trunk)
---
 docs/rh-log.txt                | 1 +
 src/actor.h                    | 1 +
 src/p_map.cpp                  | 2 +-
 src/thingdef/thingdef_data.cpp | 1 +
 4 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/docs/rh-log.txt b/docs/rh-log.txt
index 2bae0ae55..9f4646ee3 100644
--- a/docs/rh-log.txt
+++ b/docs/rh-log.txt
@@ -1,4 +1,5 @@
 August 6, 2009
+- Added MF6_NOTELEPORT flag.
 - Fixed: M_QuitResponse() tried to play a sound even when none was specified
   in the gameinfo.
 - Added Yes/No selections for Y/N messages so that you can answer them
diff --git a/src/actor.h b/src/actor.h
index 1085f1650..e866a586f 100644
--- a/src/actor.h
+++ b/src/actor.h
@@ -312,6 +312,7 @@ enum
 	MF6_BUMPSPECIAL		= 0x00000020,	// Actor executes its special when being collided (as the ST flag)
 	MF6_DONTHARMSPECIES = 0x00000040,	// Don't hurt one's own species with explosions (hitscans, too?)
 	MF6_STEPMISSILE		= 0x00000080,	// Missile can "walk" up steps
+	MF6_NOTELEFRAG		= 0x00000100,	// [HW] Actor can't be telefragged
 
 
 // --- mobj.renderflags ---
diff --git a/src/p_map.cpp b/src/p_map.cpp
index f29d1a0bd..58076a293 100644
--- a/src/p_map.cpp
+++ b/src/p_map.cpp
@@ -353,7 +353,7 @@ bool P_TeleportMove (AActor *thing, fixed_t x, fixed_t y, fixed_t z, bool telefr
 
 		// monsters don't stomp things except on boss level
 		// [RH] Some Heretic/Hexen monsters can telestomp
-		if (StompAlwaysFrags)
+		if (StompAlwaysFrags && !(th->flags6 & MF6_NOTELEFRAG))
 		{
 			P_DamageMobj (th, thing, thing, 1000000, NAME_Telefrag, DMG_THRUSTLESS);
 			continue;
diff --git a/src/thingdef/thingdef_data.cpp b/src/thingdef/thingdef_data.cpp
index 84c814b29..711592c80 100644
--- a/src/thingdef/thingdef_data.cpp
+++ b/src/thingdef/thingdef_data.cpp
@@ -218,6 +218,7 @@ static FFlagDef ActorFlags[]=
 	DEFINE_FLAG(MF6, BUMPSPECIAL, AActor, flags6),
 	DEFINE_FLAG(MF6, DONTHARMSPECIES, AActor, flags6),
 	DEFINE_FLAG(MF6, STEPMISSILE, AActor, flags6),
+	DEFINE_FLAG(MF6, NOTELEFRAG, AActor, flags6),
 
 	// Effect flags
 	DEFINE_FLAG(FX, VISIBILITYPULSE, AActor, effects),