diff --git a/.circleci/config.yml b/.circleci/config.yml
index 61e508e4d713f193edc10668849548a039c39b58..8ecee2b19d8d372a0b2c4e22d88eab3907eb6597 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -51,8 +51,8 @@ jobs:
             - /var/cache/apt/archives
       - checkout
       - run:
-          name: Compile without network support and BLUA
-          command: make -C src LINUX=1 ERRORMODE=1 -k NONET=1 NO_LUA=1
+          name: Compile without network support
+          command: make -C src LINUX=1 ERRORMODE=1 -k NONET=1
       - run:
           name: wipe build
           command: make -C src LINUX=1 cleandep
diff --git a/extras/conf/Includes/Game_SRB222.cfg b/extras/conf/Includes/Game_SRB222.cfg
index 3c4b11e9f301f90b68a5ee90c366416048946b73..2ad0dc61d0ae7cafca568ec6257a2f293afb4903 100644
--- a/extras/conf/Includes/Game_SRB222.cfg
+++ b/extras/conf/Includes/Game_SRB222.cfg
@@ -1,7 +1,7 @@
 // Default lump name for new map
 defaultlumpname = "MAP01";
 //GZDB specific. Don't try to load lumps that don't exist.
-basegame = 0;
+basegame = "Doom";
 
 //Sky textures for vanilla maps
 defaultskytextures
diff --git a/extras/conf/Includes/SRB222_common.cfg b/extras/conf/Includes/SRB222_common.cfg
index a832e6cefe6c2ba1580cbd48083bcf1c2702da81..d67835aeb3c67a6b8dee404664aa0bafd6cf312e 100644
--- a/extras/conf/Includes/SRB222_common.cfg
+++ b/extras/conf/Includes/SRB222_common.cfg
@@ -1,24 +1,40 @@
 common
 {
-	// Some common settings
+	// Simulate Doom brightness levels (turn this off for linear lighting)
+	doomlightlevels = true;
 
+	// Enables support for long (> 8 chars) texture names
+	// WARNING: this should only be enabled for UDMF game configurations!
+	// WARNING: enabling this will make maps incompatible with Doom Builder 2 and can lead to problems in Slade 3!
+	longtexturenames = false;
+
+	// These directory names are ignored when loading PK3/PK7/Directory resources
+	ignoreddirectories = ".svn .git";
 
+	// Files with these extensions are ignored when loading PK3/PK7/Directory resources
+	ignoredextensions = "wad pk3 pk7 bak backup1 backup2 backup3 zip rar 7z";
 
 	// Default testing parameters
 	testparameters = "-file \"%AP\" \"%F\" -warp %L";
 	testshortpaths = true;
 
-	// Action special help (mxd)
+	// Action special help
 	actionspecialhelp = "https://wiki.srb2.org/wiki/Linedef_type_%K";
 
-	// Default nodebuilder configurations
-	defaultsavecompiler = "zennode_normal";
-	defaulttestcompiler = "zennode_fast";
-
 	// Generalized actions
 	generalizedlinedefs = false;
 	generalizedsectors = true;
 
+	// Maximum safe map size check (0 means skip check)
+	safeboundary = 1;
+
+	// Map boundaries. Map objects can only be placed within these boundaries
+	leftboundary = -32768;
+	rightboundary = 32767;
+	topboundary = 32767;
+	bottomboundary = -32768;
+
+	// Texture loading options
 	mixtexturesflats = true;
 	defaulttexturescale = 1.0f;
 	defaultflatscale = 1.0f;
@@ -54,8 +70,12 @@ common
 
 mapformat_doom
 {
-	// The format interface handles the map data format - DoomMapSetIO for SRB2DB2, SRB2MapSetIO for Zone Builder
-	formatinterface = "SRB2MapSetIO";
+	// The format interface handles the map data format
+	formatinterface = "DoomMapSetIO";
+
+	// Default nodebuilder configurations
+	defaultsavecompiler = "zennode_normal";
+	defaulttestcompiler = "zennode_fast";
 
 	/*
 	GAME DETECT PATTERN
@@ -104,7 +124,7 @@ mapformat_doom
 	// Special linedefs
 	include("SRB222_misc.cfg", "speciallinedefs");
 
-	// Default flags for first new thing (As far as 2.2 goes, they're empty just like in 2.1)
+	// Default flags for first new thing
 	defaultthingflags
 	{
 	}
@@ -115,13 +135,13 @@ mapformat_doom
 		include("SRB222_misc.cfg", "sectorbrightness");
 	}
 
-	// SECTOR TYPES-----------------------------------------------------------------
+	// SECTOR TYPES
 	sectortypes
 	{
 		include("SRB222_sectors.cfg", "sectortypes");
 	}
 
-	// GENERALISED SECTOR TYPES-----------------------------------------------------------------
+	// GENERALISED SECTOR TYPES
 	gen_sectortypes
 	{
 		include("SRB222_sectors.cfg", "gen_sectortypes");
@@ -178,16 +198,12 @@ mapformat_udmf
 	// The format interface handles the map data format
 	formatinterface = "UniversalMapSetIO";
 
-	// Enables support for long (> 8 chars) texture names
-	// WARNING: this should only be enabled for UDMF game configurations!
-	// WARNING: enabling this will make maps incompatible with Doom Builder 2 and can lead to problems in Slade 3!
-	longtexturenames = false;
-
 	// Default nodebuilder configurations
 	defaultsavecompiler = "zdbsp_udmf_normal";
 	defaulttestcompiler = "zdbsp_udmf_fast";
 
-	engine = "srb2"; // override that so that DB2 uses the correct namespace
+	// Determines the textmap namespace
+	engine = "srb2";
 
 	maplumpnames
 	{
@@ -198,7 +214,7 @@ mapformat_udmf
 
 	universalfields
 	{
-//		include("SRB222_misc.cfg", "universalfields");
+		include("SRB222_misc.cfg", "universalfields");
 	}
 
 	// When this is set to true, sectors with the same tag will light up when a line is highlighted
@@ -207,18 +223,15 @@ mapformat_udmf
 	// Special linedefs
 	include("SRB222_misc.cfg", "speciallinedefs_udmf");
 
-	// Default flags for first new thing (As far as 2.2 goes, they're empty just like in 2.1)
+	// Default flags for first new thing
 	defaultthingflags
 	{
 	}
 
-	// Generalized actions
-	generalizedlinedefs = false;
-
 	// SECTOR FLAGS
 	sectorflags
 	{
-//		include("SRB222_misc.cfg", "sectorflags");
+		include("SRB222_misc.cfg", "sectorflags");
 	}
 
 	// DEFAULT SECTOR BRIGHTNESS LEVELS
@@ -233,11 +246,11 @@ mapformat_udmf
 		include("SRB222_sectors.cfg", "sectortypes");
 	}
 
-	// SECTOR RENSERSTYLES
-/*	sectorrenderstyles
+	// GENERALISED SECTOR TYPES
+	gen_sectortypes
 	{
-		include("SRB222_misc.cfg", "sectorrenderstyles");
-	}*/
+		include("SRB222_sectors.cfg", "gen_sectortypes");
+	}
 
 	// LINEDEF FLAGS
 	linedefflags
@@ -245,27 +258,15 @@ mapformat_udmf
 		include("SRB222_misc.cfg", "linedefflags_udmf");
 	}
 
-	// LINEDEF ACTIVATIONS
-	linedefactivations
-	{
-		include("SRB222_misc.cfg", "linedefactivations_udmf");
-	}
-
 	linedefflagstranslation
 	{
+		include("SRB222_misc.cfg", "linedefflagstranslation");
 	}
 
-
-	// LINEDEF RENSERSTYLES
-	linedefrenderstyles
+	// LINEDEF RENDERSTYLES
+	/*linedefrenderstyles
 	{
 		include("SRB222_misc.cfg", "linedefrenderstyles");
-	}
-
-	//SIDEDEF FLAGS
-/*	sidedefflags
-	{
-		include("UDMF_misc.cfg", "sidedefflags");
 	}*/
 
 	// THING FLAGS
@@ -282,23 +283,10 @@ mapformat_udmf
 		include("SRB222_misc.cfg", "thingflagstranslation");
 	}
 
-	// THING RENSERSTYLES
-/*	thingrenderstyles
-	{
-		include("SRB222_misc.cfg", "thingrenderstyles");
-	}*/
-
 	// How to compare thing flags (for the stuck things error checker)
-/*	thingflagscompare
+	thingflagscompare
 	{
 		include("UDMF_misc.cfg", "thingflagscompare");
-	}*/
-
-	//mxd. Thing flags UDMF translation table
-	// This is needed for copy/paste and prefabs to work properly
-	// When the UDMF field name is prefixed with ! it is inverted
-	thingflagstranslation
-	{
 	}
 
 	// LINEDEF TYPES
diff --git a/extras/conf/Includes/SRB222_linedefs.cfg b/extras/conf/Includes/SRB222_linedefs.cfg
index 9f6613620ed982fc8866c7bcb7bb449c13677470..7073960783c69f3fed29f34cd8c68faec45f2d43 100644
--- a/extras/conf/Includes/SRB222_linedefs.cfg
+++ b/extras/conf/Includes/SRB222_linedefs.cfg
@@ -9,72 +9,56 @@ doom
 			title = "None";
 			prefix = "(0)";
 		}
-
 		1
 		{
 			title = "Per-Sector Gravity";
 			prefix = "(1)";
-			flags64text = "[6] Flip in reverse gravity";
 		}
-
 		5
 		{
 			title = "Camera Scanner";
 			prefix = "(5)";
 		}
-
 		7
 		{
 			title = "Sector Flat Alignment";
 			prefix = "(7)";
-			flags2048text = "[11] Don't align floor";
-			flags4096text = "[12] Don't align ceiling";
-			flags8192text = "[13] Use texture offsets";
 		}
-
 		10
 		{
 			title = "Culling Plane";
 			prefix = "(10)";
-			flags64text = "[6] Cull only while in sector";
 		}
-
 		13
 		{
 			title = "Heat Wave Effect";
 			prefix = "(13)";
 		}
-
-	    40
+		40
 		{
 			title = "Visual Portal Between Tagged Linedefs";
 			prefix = "(40)";
 		}
-
-	    41
+		41
 		{
 			title = "Horizon Effect";
 			prefix = "(41)";
 		}
-
 		50
 		{
 			title = "Instantly Lower Floor on Level Load";
 			prefix = "(50)";
 		}
-
 		51
 		{
 			title = "Instantly Raise Ceiling on Level Load";
 			prefix = "(51)";
 		}
-
 		63
 		{
 			title = "Fake Floor/Ceiling Planes";
 			prefix = "(63)";
 		}
-
 		540
 		{
 			title = "Floor Friction";
@@ -90,90 +74,57 @@ doom
 		{
 			title = "Custom Exit";
 			prefix = "(2)";
-			flags2text = "[1] Check emeralds";
-			flags64text = "[6] Skip score tally";
 		}
-
 		3
 		{
 			title = "Zoom Tube Parameters";
 			prefix = "(3)";
-			flags512text = "[9] Ignore player direction";
 		}
-
 		4
 		{
 			title = "Speed Pad Parameters";
 			prefix = "(4)";
-			flags512text = "[9] No teleport to center";
-			flags1024text = "[10] Force spinning frames";
 		}
-
 		8
 		{
 			title = "Special Sector Properties";
 			prefix = "(8)";
-			flags32text = "[5] Invert precipitation";
-			flags64text = "[6] Touch only ceiling";
-			flags128text = "[7] Allow opposite gravity";
-			flags256text = "[8] Touch sector edge";
-			flags512text = "[9] Touch floor or ceiling";
 		}
-
 		9
 		{
 			title = "Chain Parameters";
 			prefix = "(9)";
-			flags32text = "[5] Swing instead of spin";
-			flags64text = "[6] Player-turnable chain";
-			flags128text = "[7] Make chain from end item";
-			flags256text = "[8] Spawn link at origin";
-			flags512text = "[9] Don't clip inside ground";
-			flags1024text = "[10] No distance check";
 		}
-
 		11
 		{
 			title = "Rope Hang Parameters";
 			prefix = "(11)";
-			flags32text = "[5] Don't loop";
-			flags64text = "[6] Static";
 		}
-
 		12
 		{
 			title = "Rock Spawner Parameters";
 			prefix = "(12)";
-			flags64text = "[6] Randomize speed";
 		}
-
 		14
 		{
 			title = "Bustable Block Parameters";
 			prefix = "(14)";
-			flags32text = "[5] Particles launch from center";
 		}
-
 		15
 		{
 			title = "Fan Particle Spawner Parameters";
 			prefix = "(15)";
 		}
-
 		16
 		{
 			title = "Minecart Parameters";
 			prefix = "(16)";
 		}
-
 		64
 		{
 			title = "Continuously Appearing/Disappearing FOF";
 			prefix = "(64)";
-			flags2text = "[1] Use control sector tag";
-			flags64text = "[6] No sound effect";
 		}
-
 		65
 		{
 			title = "Bridge Thinker <disabled>";
@@ -190,42 +141,30 @@ doom
 			title = "First Line";
 			prefix = "(20)";
 		}
-
 		21
 		{
 			title = "Explicitly Include Line <disabled>";
 			prefix = "(21)";
 		}
-
 		22
 		{
 			title = "Parameters";
 			prefix = "(22)";
-			flags64text = "[6] Trigger linedef executor";
-			flags128text = "[7] Intangible";
-			flags256text = "[8] Stopped by pushables";
-			flags512text = "[9] Render flats";
 		}
-
 		30
 		{
 			title = "Waving Flag";
 			prefix = "(30)";
 		}
-
 		31
 		{
 			title = "Displacement by Front Sector";
 			prefix = "(31)";
 		}
-
 		32
 		{
 			title = "Angular Displacement by Front Sector";
 			prefix = "(32)";
-			flags8text = "[3] Set delay by backside sector";
-			flags64text = "[6] Don't turn players";
-			flags512text = "[9] Turn all objects";
 		}
 	}
 
@@ -237,92 +176,71 @@ doom
 		{
 			title = "Continuously Falling Sector";
 			prefix = "(52)";
-			flags64text = "[6] Continuously rising";
 		}
-
 		53
 		{
 			title = "Continuous Floor/Ceiling Mover";
 			prefix = "(53)";
 		}
-
 		54
 		{
 			title = "Continuous Floor Mover";
 			prefix = "(54)";
 		}
-
 		55
 		{
 			title = "Continuous Ceiling Mover";
 			prefix = "(55)";
 		}
-
 		56
 		{
 			title = "Continuous Two-Speed Floor/Ceiling Mover";
 			prefix = "(56)";
 		}
-
 		57
 		{
 			title = "Continuous Two-Speed Floor Mover";
 			prefix = "(57)";
 		}
-
 		58
 		{
 			title = "Continuous Two-Speed Ceiling Mover";
 			prefix = "(58)";
 		}
-
 		59
 		{
 			title = "Activate Moving Platform";
 			prefix = "(59)";
-			flags64text = "[6] Move upwards at start";
 		}
-
 		60
 		{
 			title = "Activate Moving Platform (Adjustable Speed)";
 			prefix = "(60)";
-			flags64text = "[6] Move upwards at start";
 		}
-
 		61
 		{
 			title = "Crusher (Ceiling to Floor)";
 			prefix = "(61)";
-			flags512text = "[9] Double, constant speed";
 		}
-
 		62
 		{
 			title = "Crusher (Floor to Ceiling)";
 			prefix = "(62)";
-			flags512text = "[9] Double, constant speed";
 		}
-
 		66
 		{
 			title = "Move Floor by Displacement";
 			prefix = "(66)";
-			flags64text = "[6] Inverse movement";
 		}
-
 		67
 		{
 			title = "Move Ceiling by Displacement";
 			prefix = "(67)";
-			flags64text = "[6] Inverse movement";
 		}
-
 		68
 		{
 			title = "Move Floor and Ceiling by Displacement";
 			prefix = "(68)";
-			flags64text = "[6] Inverse movement";
 		}
 	}
 
@@ -334,159 +252,66 @@ doom
 		{
 			title = "Solid, Opaque";
 			prefix = "(100)";
-			flags8text = "[3] Slope skew sides";
-			flags32text = "[5] Only block player";
-			flags128text = "[7] Only block non-players";
-			3dfloor = true;
-			3dfloorflags = "19F";
 		}
-
 		101
 		{
 			title = "Solid, Opaque, No Shadow";
 			prefix = "(101)";
-			flags8text = "[3] Slope skew sides";
-			flags32text = "[5] Only block player";
-			flags128text = "[7] Only block non-players";
-			3dfloor = true;
-			3dfloorflags = "1DF";
 		}
-
 		102
 		{
 			title = "Solid, Translucent";
 			prefix = "(102)";
-			flags8text = "[3] Slope skew sides";
-			flags32text = "[5] Only block player";
-			flags64text = "[6] Render insides";
-			flags128text = "[7] Only block non-players";
-			3dfloor = true;
-			3dfloorflags = "195F";
-			flags643dfloorflagsadd = "7C80";
 		}
-
 		103
 		{
 			title = "Solid, Sides Only";
 			prefix = "(103)";
-			flags8text = "[3] Slope skew sides";
-			flags32text = "[5] Only block player";
-			flags128text = "[7] Only block non-players";
-			3dfloor = true;
-			3dfloorflags = "1CF";
 		}
-
 		104
 		{
 			title = "Solid, No Sides";
 			prefix = "(104)";
-			flags32text = "[5] Only block player";
-			flags64text = "[6] Cast shadow";
-			flags128text = "[7] Only block non-players";
-			3dfloor = true;
-			3dfloorflags = "1D7";
-			flags643dfloorflagsremove = "40";
 		}
-
 		105
 		{
 			title = "Solid, Invisible";
 			prefix = "(105)";
-			flags32text = "[5] Only block player";
-			flags128text = "[7] Only block non-players";
-			3dfloor = true;
-			3dfloorflags = "47";
 		}
-
 		140
 		{
 			title = "Intangible from Bottom, Opaque";
 			prefix = "(140)";
-			flags8text = "[3] Slope skew sides";
-			flags32text = "[5] Only block player";
-			flags64text = "[6] Don't cast shadow";
-			flags128text = "[7] Only block non-players";
-			3dfloor = true;
-			3dfloorflags = "200841F";
-			flags643dfloorflagsadd = "40";
 		}
-
 		141
 		{
 			title = "Intangible from Bottom, Translucent";
 			prefix = "(141)";
-			flags8text = "[3] Slope skew sides";
-			flags32text = "[5] Only block player";
-			flags64text = "[6] Don't cast shadow";
-			flags128text = "[7] Render insides/block non-plr";
-			3dfloor = true;
-			3dfloorflags = "200191F";
-			flags1283dfloorflagsadd = "7C80";
-			flags643dfloorflagsadd = "40";
 		}
-
 		142
 		{
 			title = "Intangible from Bottom, Translucent, No Sides";
 			prefix = "(142)";
-			flags32text = "[5] Only block player";
-			flags64text = "[6] Don't cast shadow";
-			flags128text = "[7] Render insides/block non-plr";
-			3dfloor = true;
-			3dfloorflags = "2001917";
-			flags1283dfloorflagsadd = "7C80";
-			flags643dfloorflagsadd = "40";
 		}
-
 		143
 		{
 			title = "Intangible from Top, Opaque";
 			prefix = "(143)";
-			flags8text = "[3] Slope skew sides";
-			flags32text = "[5] Only block player";
-			flags64text = "[6] Don't cast shadow";
-			flags128text = "[7] Only block non-players";
-			3dfloor = true;
-			3dfloorflags = "400841F";
-			flags643dfloorflagsadd = "40";
 		}
-
 		144
 		{
 			title = "Intangible from Top, Translucent";
 			prefix = "(144)";
-			flags8text = "[3] Slope skew sides";
-			flags32text = "[5] Only block player";
-			flags64text = "[6] Don't cast shadow";
-			flags128text = "[7] Render insides/block non-plr";
-			3dfloor = true;
-			3dfloorflags = "400191F";
-			flags1283dfloorflagsadd = "7C80";
-			flags643dfloorflagsadd = "40";
 		}
-
 		145
 		{
 			title = "Intangible from Top, Translucent, No Sides";
 			prefix = "(145)";
-			flags32text = "[5] Only block player";
-			flags64text = "[6] Don't cast shadow";
-			flags128text = "[7] Render insides/block non-plr";
-			3dfloor = true;
-			3dfloorflags = "4001917";
-			flags1283dfloorflagsadd = "7C80";
-			flags643dfloorflagsadd = "40";
 		}
-
 		146
 		{
 			title = "Only Tangible from Sides";
 			prefix = "(146)";
-			flags8text = "[3] Slope skew sides";
-			flags32text = "[5] Only block player";
-			flags128text = "[7] Only block non-players";
-			3dfloor = true;
-			3dfloorflags = "600800F";
 		}
 	}
 
@@ -498,127 +323,51 @@ doom
 		{
 			title = "Water, Opaque";
 			prefix = "(120)";
-			flags8text = "[3] Slope skew sides";
-			flags64text = "[6] Use two light levels";
-			flags512text = "[9] Use target light level";
-			flags1024text = "[10] Ripple effect";
-			3dfloor = true;
-			3dfloorflags = "8F39";
-			flags643dfloorflagsadd = "20000";
-			flags5123dfloorflagsadd = "80000000";
-			flags10243dfloorflagsadd = "40000000";
 		}
-
 		121
 		{
 			title = "Water, Translucent";
 			prefix = "(121)";
-			flags8text = "[3] Slope skew sides";
-			flags64text = "[6] Use two light levels";
-			flags512text = "[9] Use target light level";
-			flags1024text = "[10] Ripple effect";
-			3dfloor = true;
-			3dfloorflags = "9F39";
-			flags643dfloorflagsadd = "20000";
-			flags5123dfloorflagsadd = "80000000";
-			flags10243dfloorflagsadd = "40000000";
 		}
-
 		122
 		{
 			title = "Water, Opaque, No Sides";
 			prefix = "(122)";
-			flags64text = "[6] Use two light levels";
-			flags512text = "[9] Use target light level";
-			flags1024text = "[10] Ripple effect";
-			3dfloor = true;
-			3dfloorflags = "F31";
-			flags643dfloorflagsadd = "20000";
-			flags5123dfloorflagsadd = "80000000";
-			flags10243dfloorflagsadd = "40000000";
 		}
-
 		123
 		{
 			title = "Water, Translucent, No Sides";
 			prefix = "(123)";
-			flags64text = "[6] Use two light levels";
-			flags512text = "[9] Use target light level";
-			flags1024text = "[10] Ripple effect";
-			3dfloor = true;
-			3dfloorflags = "1F31";
-			flags643dfloorflagsadd = "20000";
-			flags5123dfloorflagsadd = "80000000";
-			flags10243dfloorflagsadd = "40000000";
 		}
-
 		124
 		{
 			title = "Goo Water, Translucent";
 			prefix = "(124)";
-			flags8text = "[3] Slope skew sides";
-			flags64text = "[6] Use two light levels";
-			flags512text = "[9] Use target light level";
-			flags1024text = "[10] Ripple effect";
-			3dfloor = true;
-			3dfloorflags = "209F39";
-			flags643dfloorflagsadd = "20000";
-			flags5123dfloorflagsadd = "80000000";
-			flags10243dfloorflagsadd = "40000000";
 		}
-
 		125
 		{
 			title = "Goo Water, Translucent, No Sides";
 			prefix = "(125)";
-			flags8text = "[3] Slope skew sides";
-			flags64text = "[6] Use two light levels";
-			flags512text = "[9] Use target light level";
-			flags1024text = "[10] Ripple effect";
-			3dfloor = true;
-			3dfloorflags = "201F31";
-			flags643dfloorflagsadd = "20000";
-			flags5123dfloorflagsadd = "80000000";
-			flags10243dfloorflagsadd = "40000000";
 		}
-
 		220
 		{
 			title = "Intangible, Opaque";
 			prefix = "(220)";
-			flags8text = "[3] Slope skew sides";
-			3dfloor = true;
-			3dfloorflags = "8F19";
 		}
-
 		221
 		{
 			title = "Intangible, Translucent";
 			prefix = "(221)";
-			flags8text = "[3] Slope skew sides";
-			flags64text = "[6] Cast shadow";
-			3dfloor = true;
-			3dfloorflags = "1B59";
-			flags643dfloorflagsremove = "40";
 		}
-
 		222
 		{
 			title = "Intangible, Sides Only";
 			prefix = "(222)";
-			flags8text = "[3] Slope skew sides";
-			flags64text = "[6] Cast shadow";
-			3dfloor = true;
-			3dfloorflags = "8249";
-			flags643dfloorflagsremove = "240";
 		}
-
 		223
 		{
 			title = "Intangible, Invisible";
 			prefix = "(223)";
-			3dfloor = true;
-			3dfloorflags = "41";
 		}
 	}
 
@@ -630,127 +379,56 @@ doom
 		{
 			title = "Air Bobbing";
 			prefix = "(150)";
-			flags8text = "[3] Slope skew sides";
-			flags32text = "[5] Only block player";
-			flags64text = "[6] Spindash to move";
-			flags128text = "[7] Only block non-players";
-			3dfloor = true;
-			3dfloorflags = "19F";
 		}
-
 		151
 		{
 			title = "Air Bobbing (Adjustable)";
 			prefix = "(151)";
-			flags8text = "[3] Slope skew sides";
-			flags32text = "[5] Only block player";
-			flags64text = "[6] Spindash to move";
-			flags128text = "[7] Only block non-players";
-			3dfloor = true;
-			3dfloorflags = "19F";
 		}
-
 		152
 		{
 			title = "Reverse Air Bobbing (Adjustable)";
 			prefix = "(152)";
-			flags8text = "[3] Slope skew sides";
-			flags32text = "[5] Only block player";
-			flags64text = "[6] Spindash to move";
-			flags128text = "[7] Only block non-players";
-			3dfloor = true;
-			3dfloorflags = "19F";
 		}
-
+		153
+		{
+			title = "Dynamically Sinking Platform";
+			prefix = "(153)";
+		}
 		160
 		{
 			title = "Floating, Bobbing";
 			prefix = "(160)";
-			flags8text = "[3] Slope skew sides";
-			flags32text = "[5] Only block player";
-			flags128text = "[7] Only block non-players";
-			3dfloor = true;
-			3dfloorflags = "4019F";
 		}
-
 		190
 		{
 			title = "Rising Platform, Solid, Opaque";
 			prefix = "(190)";
-			flags2text = "[1] Sink when stepped on";
-			flags8text = "[3] Slope skew sides";
-			flags32text = "[5] Only block player";
-			flags64text = "[6] Spindash to move";
-			flags128text = "[7] Only block non-players";
-			3dfloor = true;
-			3dfloorflags = "19F";
 		}
-
 		191
 		{
 			title = "Rising Platform, Solid, Opaque, No Shadow";
 			prefix = "(191)";
-			flags2text = "[1] Sink when stepped on";
-			flags8text = "[3] Slope skew sides";
-			flags32text = "[5] Only block player";
-			flags64text = "[6] Spindash to move";
-			flags128text = "[7] Only block non-players";
-			3dfloor = true;
-			3dfloorflags = "1DF";
 		}
-
 		192
 		{
 			title = "Rising Platform, Solid, Translucent";
 			prefix = "(192)";
-			flags2text = "[1] Sink when stepped on";
-			flags8text = "[3] Slope skew sides";
-			flags32text = "[5] Only block player";
-			flags64text = "[6] Spindash to move";
-			flags128text = "[7] Only block non-players";
-			3dfloor = true;
-			3dfloorflags = "195F";
 		}
-
 		193
 		{
 			title = "Rising Platform, Solid, Invisible";
 			prefix = "(193)";
-			flags2text = "[1] Sink when stepped on";
-			flags8text = "[3] Slope skew sides";
-			flags32text = "[5] Only block player";
-			flags64text = "[6] Spindash to move";
-			flags128text = "[7] Only block non-players";
-			3dfloor = true;
-			3dfloorflags = "47";
 		}
-
 		194
 		{
 			title = "Rising Platform, Intangible from Bottom, Opaque";
 			prefix = "(194)";
-			flags2text = "[1] Sink when stepped on";
-			flags8text = "[3] Slope skew sides";
-			flags32text = "[5] Only block player";
-			flags64text = "[6] Spindash, no shadow";
-			flags128text = "[7] Only block non-players";
-			3dfloor = true;
-			3dfloorflags = "200841F";
-			flags643dfloorflagsadd = "40";
 		}
-
 		195
 		{
 			title = "Rising Platform, Intangible from Bottom, Translucent";
 			prefix = "(195)";
-			flags2text = "[1] Sink when stepped on";
-			flags8text = "[3] Slope skew sides";
-			flags32text = "[5] Only block player";
-			flags64text = "[6] Spindash, no shadow";
-			flags128text = "[7] Only block non-players";
-			3dfloor = true;
-			3dfloorflags = "2009D1F";
-			flags643dfloorflagsadd = "40";
 		}
 	}
 
@@ -762,132 +440,56 @@ doom
 		{
 			title = "Crumbling, Respawn";
 			prefix = "(170)";
-			flags8text = "[3] Slope skew sides";
-			flags32text = "[5] Only block player";
-			flags128text = "[7] Only block non-players";
-			3dfloor = true;
-			3dfloorflags = "10019F";
 		}
-
 		171
 		{
 			title = "Crumbling, No Respawn";
 			prefix = "(171)";
-			flags8text = "[3] Slope skew sides";
-			flags32text = "[5] Only block player";
-			flags128text = "[7] Only block non-players";
-			3dfloor = true;
-			3dfloorflags = "80019F";
 		}
-
 		172
 		{
 			title = "Crumbling, Respawn, Intangible from Bottom";
 			prefix = "(172)";
-			flags8text = "[3] Slope skew sides";
-			flags32text = "[5] Only block player";
-			flags64text = "[6] Don't cast shadow";
-			flags128text = "[7] Only block non-players";
-			3dfloor = true;
-			3dfloorflags = "210841F";
-			flags643dfloorflagsadd = "40";
 		}
-
 		173
 		{
 			title = "Crumbling, No Respawn, Intangible from Bottom";
 			prefix = "(173)";
-			flags8text = "[3] Slope skew sides";
-			flags32text = "[5] Only block player";
-			flags64text = "[6] Don't cast shadow";
-			flags128text = "[7] Only block non-players";
-			3dfloor = true;
-			3dfloorflags = "218841F";
-			flags643dfloorflagsadd = "40";
 		}
-
 		174
 		{
 			title = "Crumbling, Respawn, Int. from Bottom, Translucent";
 			prefix = "(174)";
-			flags8text = "[3] Slope skew sides";
-			flags32text = "[5] Only block player";
-			flags64text = "[6] Don't cast shadow";
-			flags128text = "[7] Only block non-players";
-			3dfloor = true;
-			3dfloorflags = "210959F";
-			flags643dfloorflagsadd = "40";
 		}
-
 		175
 		{
 			title = "Crumbling, No Respawn, Int. from Bottom, Translucent";
 			prefix = "(175)";
-			flags8text = "[3] Slope skew sides";
-			flags32text = "[5] Only block player";
-			flags64text = "[6] Don't cast shadow";
-			flags128text = "[7] Only block non-players";
-			3dfloor = true;
-			3dfloorflags = "218959F";
-			flags643dfloorflagsadd = "40";
 		}
-
 		176
 		{
 			title = "Crumbling, Respawn, Floating, Bobbing";
 			prefix = "(176)";
-			flags8text = "[3] Slope skew sides";
-			flags32text = "[5] Only block player";
-			flags64text = "[6] Spindash to move";
-			flags128text = "[7] Only block non-players";
-			3dfloor = true;
-			3dfloorflags = "14019F";
 		}
-
 		177
 		{
 			title = "Crumbling, No Respawn, Floating, Bobbing";
 			prefix = "(177)";
-			flags8text = "[3] Slope skew sides";
-			flags32text = "[5] Only block player";
-			flags64text = "[6] Spindash to move";
-			flags128text = "[7] Only block non-players";
-			3dfloor = true;
-			3dfloorflags = "1C019F";
 		}
-
 		178
 		{
 			title = "Crumbling, Respawn, Floating";
 			prefix = "(178)";
-			flags8text = "[3] Slope skew sides";
-			flags32text = "[5] Only block player";
-			flags128text = "[7] Only block non-players";
-			3dfloor = true;
-			3dfloorflags = "14019F";
 		}
-
 		179
 		{
 			title = "Crumbling, No Respawn, Floating";
 			prefix = "(179)";
-			flags8text = "[3] Slope skew sides";
-			flags32text = "[5] Only block player";
-			flags128text = "[7] Only block non-players";
-			3dfloor = true;
-			3dfloorflags = "1C019F";
 		}
-
 		180
 		{
 			title = "Crumbling, Respawn, Air Bobbing";
 			prefix = "(180)";
-			flags8text = "[3] Slope skew sides";
-			flags32text = "[5] Only block player";
-			flags64text = "[6] Spindash to move";
-			flags128text = "[7] Only block non-players";
-			3dfloor = true;
-			3dfloorflags = "10019F";
 		}
 	}
 
@@ -899,141 +501,66 @@ doom
 		{
 			title = "Light Block";
 			prefix = "(200)";
-			3dfloor = true;
-			3dfloorflags = "20201";
 		}
-
 		201
 		{
 			title = "Half Light Block";
 			prefix = "(201)";
-			3dfloor = true;
-			3dfloorflags = "201";
 		}
-
 		202
 		{
 			title = "Fog Block";
 			prefix = "(202)";
-			3dfloor = true;
-			3dfloorflags = "3EF19";
 		}
-
 		250
 		{
 			title = "Mario Block";
 			prefix = "(250)";
-			flags32text = "[5] Invisible block";
-			flags64text = "[6] Brick block";
-			3dfloor = true;
-			3dfloorflags = "40019F";
 		}
-
 		251
 		{
 			title = "Thwomp Block";
 			prefix = "(251)";
-			flags512text = "[9] Custom crushing sound";
-			flags1024text = "[10] Custom speed";
-			3dfloor = true;
-			3dfloorflags = "19F";
 		}
-
 		252
 		{
 			title = "Shatter Block";
 			prefix = "(252)";
-			flags8text = "[3] Slope skew sides";
-			flags64text = "[6] Shatter only from below";
-			flags512text = "[9] Shattered by pushables";
-			flags1024text = "[10] Trigger linedef executor";
-			3dfloor = true;
-			3dfloorflags = "8800019";
-			flags643dfloorflagsadd = "200006";
 		}
-
 		253
 		{
 			title = "Shatter Block, Translucent";
 			prefix = "(253)";
-			flags8text = "[3] Slope skew sides";
-			flags512text = "[9] Shattered by pushables";
-			flags1024text = "[10] Trigger linedef executor";
-			3dfloor = true;
-			3dfloorflags = "8801019";
 		}
-
 		254
 		{
 			title = "Bustable Block";
 			prefix = "(254)";
-			flags8text = "[3] Slope skew sides";
-			flags64text = "[6] Strong characters only";
-			flags128text = "[7] Only block non-players";
-			flags512text = "[9] Shattered by pushables";
-			flags1024text = "[10] Trigger linedef executor";
-			3dfloor = true;
-			3dfloorflags = "80001F";
-			flags643dfloorflagsadd = "20000000";
 		}
-
 		255
 		{
 			title = "Spin-Bustable Block";
 			prefix = "(255)";
-			flags8text = "[3] Slope skew sides";
-			flags32text = "[5] Only block player";
-			flags128text = "[7] Only block non-players";
-			flags512text = "[9] Shattered by pushables";
-			flags1024text = "[10] Trigger linedef executor";
-			3dfloor = true;
-			3dfloorflags = "1080001F";
 		}
-
 		256
 		{
 			title = "Spin-Bustable Block, Translucent";
 			prefix = "(256)";
-			flags8text = "[3] Slope skew sides";
-			flags32text = "[5] Only block player";
-			flags128text = "[7] Only block non-players";
-			flags512text = "[9] Shattered by pushables";
-			flags1024text = "[10] Trigger linedef executor";
-			3dfloor = true;
-			3dfloorflags = "1080101F";
 		}
-
 		257
 		{
 			title = "Quicksand";
 			prefix = "(257)";
-			flags8text = "[3] Slope skew sides";
-			flags1024text = "[10] Ripple effect";
-			3dfloor = true;
-			3dfloorflags = "1008219";
-			flags10243dfloorflagsadd = "40000000";
 		}
-
 		258
 		{
 			title = "Laser";
 			prefix = "(258)";
-			flags8text = "[3] Slope skew sides";
-			flags32text = "[5] Don't damage bosses";
-			3dfloor = true;
-			3dfloorflags = "959";
 		}
-
 		259
 		{
 			title = "Custom FOF";
 			prefix = "(259)";
-			flags32text = "[5] Only block player";
-			flags128text = "[7] Only block non-players";
-			flags512text = "[9] Shattered by pushables";
-			flags1024text = "[10] Trigger linedef executor";
-			3dfloor = true;
-			3dfloorcustom = true;
 		}
 	}
 
@@ -1046,291 +573,167 @@ doom
 			title = "Continuous";
 			prefix = "(300)";
 		}
-
 		301
 		{
 			title = "Each Time";
 			prefix = "(301)";
-			flags16384text = "[14] Also trigger on exit";
 		}
-
 		302
 		{
 			title = "Once";
 			prefix = "(302)";
 		}
-
 		303
 		{
 			title = "Ring Count - Continuous";
 			prefix = "(303)";
-			flags2text = "[1] Rings greater or equal";
-			flags64text = "[6] Rings less or equal";
-			flags512text = "[9] Consider all players";
 		}
-
 		304
 		{
 			title = "Ring Count - Once";
 			prefix = "(304)";
-			flags2text = "[1] Rings greater or equal";
-			flags64text = "[6] Rings less or equal";
-			flags512text = "[9] Consider all players";
 		}
-
 		305
 		{
 			title = "Character Ability - Continuous";
 			prefix = "(305)";
 		}
-
 		306
 		{
 			title = "Character Ability - Each Time";
 			prefix = "(306)";
-			flags16384text = "[14] Also trigger on exit";
 		}
-
 		307
 		{
 			title = "Character Ability - Once";
 			prefix = "(307)";
 		}
-
 		308
 		{
 			title = "Race Only - Once";
 			prefix = "(308)";
 		}
-
 		309
 		{
 			title = "CTF Red Team - Continuous";
 			prefix = "(309)";
 		}
-
 		310
 		{
 			title = "CTF Red Team - Each Time";
 			prefix = "(310)";
-			flags16384text = "[14] Also trigger on exit";
 		}
-
 		311
 		{
 			title = "CTF Blue Team - Continuous";
 			prefix = "(311)";
 		}
-
 		312
 		{
 			title = "CTF Blue Team - Each Time";
 			prefix = "(312)";
-			flags16384text = "[14] Also trigger on exit";
 		}
-
 		313
 		{
 			title = "No More Enemies - Once";
 			prefix = "(313)";
 		}
-
 		314
 		{
 			title = "Number of Pushables - Continuous";
 			prefix = "(314)";
-			flags64text = "[6] Number greater or equal";
-			flags512text = "[9] Number less";
 		}
-
 		315
 		{
 			title = "Number of Pushables - Once";
 			prefix = "(315)";
-			flags64text = "[6] Number greater or equal";
-			flags512text = "[9] Number less";
 		}
-
 		317
 		{
 			title = "Condition Set Trigger - Continuous";
 			prefix = "(317)";
 		}
-
 		318
 		{
 			title = "Condition Set Trigger - Once";
 			prefix = "(318)";
 		}
-
 		319
 		{
 			title = "Unlockable - Continuous";
 			prefix = "(319)";
 		}
-
 		320
 		{
 			title = "Unlockable - Once";
 			prefix = "(320)";
 		}
-
 		321
 		{
 			title = "Trigger After X Calls - Continuous";
 			prefix = "(321)";
-			flags64text = "[6] Trigger more than once";
-
 		}
-
 		322
 		{
 			title = "Trigger After X Calls - Each Time";
 			prefix = "(322)";
-			flags64text = "[6] Trigger more than once";
 		}
-
 		323
 		{
 			title = "NiGHTSerize - Each Time";
 			prefix = "(323)";
-			flags2text = "[1] Mare >= Front X Offset";
-			flags8text = "[3] Run only if player is NiGHTS";
-			flags16text = "[4] Count from lowest of players";
-			flags32text = "[5] Lap <= Front Y Offset";
-			flags64text = "[6] Mare <= Front X Offset";
-			flags128text = "[7] Lap >= Front Y Offset";
-			flags256text = "[8] Count laps from Bonus Time";
-			flags512text = "[9] Count from triggering player";
-			flags16384text = "[14] Run if no more mares";
-			flags32768text = "[15] Run if player is not NiGHTS";
 		}
-
 		324
 		{
 			title = "NiGHTSerize - Once";
-			flags2text = "[1] Mare >= Front X Offset";
-			flags8text = "[3] Run only if player is NiGHTS";
-			flags16text = "[4] Count from lowest of players";
-			flags32text = "[5] Lap <= Front Y Offset";
-			flags64text = "[6] Mare <= Front X Offset";
-			flags128text = "[7] Lap >= Front Y Offset";
-			flags256text = "[8] Count laps from Bonus Time";
-			flags512text = "[9] Count from triggering player";
-			flags16384text = "[14] Run if no more mares";
-			flags32768text = "[15] Run if player is not NiGHTS";
 			prefix = "(324)";
 		}
-
 		325
 		{
 			title = "De-NiGHTSerize - Each Time";
-			flags2text = "[1] Mare >= Front X Offset";
-			flags8text = "[3] Run if anyone is NiGHTS";
-			flags16text = "[4] Count from lowest of players";
-			flags32text = "[5] Lap <= Front Y Offset";
-			flags64text = "[6] Mare <= Front X Offset";
-			flags128text = "[7] Lap >= Front Y Offset";
-			flags256text = "[8] Count laps from Bonus Time";
-			flags512text = "[9] Count from triggering player";
-			flags32768text = "[15] Run if no one is NiGHTS";
 			prefix = "(325)";
 		}
-
 		326
 		{
 			title = "De-NiGHTSerize - Once";
-			flags2text = "[1] Mare >= Front X Offset";
-			flags8text = "[3] Run if anyone is NiGHTS";
-			flags16text = "[4] Count from lowest of players";
-			flags32text = "[5] Lap <= Front Y Offset";
-			flags64text = "[6] Mare <= Front X Offset";
-			flags128text = "[7] Lap >= Front Y Offset";
-			flags256text = "[8] Count laps from Bonus Time";
-			flags512text = "[9] Count from triggering player";
-			flags32768text = "[15] Run if no one is NiGHTS";
 			prefix = "(326)";
 		}
-
 		327
 		{
 			title = "NiGHTS Lap - Each Time";
-			flags2text = "[1] Mare >= Front X Offset";
-			flags16text = "[4] Count from lowest of players";
-			flags32text = "[5] Lap <= Front Y Offset";
-			flags64text = "[6] Mare <= Front X Offset";
-			flags128text = "[7] Lap >= Front Y Offset";
-			flags256text = "[8] Count laps from Bonus Time";
-			flags512text = "[9] Count from triggering player";
 			prefix = "(327)";
 		}
-
 		328
 		{
 			title = "NiGHTS Lap - Once";
-			flags2text = "[1] Mare >= Front X Offset";
-			flags16text = "[4] Count from lowest of players";
-			flags32text = "[5] Lap <= Front Y Offset";
-			flags64text = "[6] Mare <= Front X Offset";
-			flags128text = "[7] Lap >= Front Y Offset";
-			flags256text = "[8] Count laps from Bonus Time";
-			flags512text = "[9] Count from triggering player";
 			prefix = "(328)";
 		}
-
 		329
 		{
 			title = "Ideya Capture Touch - Each Time";
-			flags2text = "[1] Mare >= Front X Offset";
-			flags8text = "[3] Run regardless of spheres";
-			flags16text = "[4] Count from lowest of players";
-			flags32text = "[5] Lap <= Front Y Offset";
-			flags64text = "[6] Mare <= Front X Offset";
-			flags128text = "[7] Lap >= Front Y Offset";
-			flags256text = "[8] Count laps from Bonus Time";
-			flags512text = "[9] Count from triggering player";
-			flags16384text = "[14] Only if not enough spheres";
-			flags32768text = "[15] Run when entering Capture";
 			prefix = "(329)";
 		}
-
 		330
 		{
 			title = "Ideya Capture Touch - Once";
-			flags2text = "[1] Mare >= Front X Offset";
-			flags8text = "[3] Run regardless of spheres";
-			flags16text = "[4] Count from lowest of players";
-			flags32text = "[5] Lap <= Front Y Offset";
-			flags64text = "[6] Mare <= Front X Offset";
-			flags128text = "[7] Lap >= Front Y Offset";
-			flags256text = "[8] Count laps from Bonus Time";
-			flags512text = "[9] Count from triggering player";
-			flags16384text = "[14] Only if not enough spheres";
-			flags32768text = "[15] Run when entering Capture";
 			prefix = "(330)";
 		}
-
 		331
 		{
 			title = "Player Skin - Continuous";
 			flags64text = "[6] Disable for this skin";
 			prefix = "(331)";
 		}
-
 		332
 		{
 			title = "Player Skin - Each Time";
-			flags64text = "[6] Disable for this skin";
 			prefix = "(332)";
 		}
-
 		333
 		{
 			title = "Player Skin - Once";
-			flags64text = "[6] Disable for this skin";
 			prefix = "(333)";
 		}
-
 		399
 		{
 			title = "Level Load";
@@ -1346,92 +749,61 @@ doom
 		{
 			title = "Set Tagged Sector's Floor Height/Texture";
 			prefix = "(400)";
-			flags8text = "[3] Set delay by backside sector";
-			flags64text = "[6] Keep floor flat";
 		}
-
 		401
 		{
 			title = "Set Tagged Sector's Ceiling Height/Texture";
 			prefix = "(401)";
-			flags8text = "[3] Set delay by backside sector";
 		}
-
 		402
 		{
 			title = "Set Tagged Sector's Light Level";
 			prefix = "(402)";
-			flags8text = "[3] Set delay by backside sector";
 		}
-
 		409
 		{
 			title = "Change Tagged Sector's Tag";
 			prefix = "(409)";
-			flags8text = "[3] Set delay by backside sector";
 		}
-
 		410
 		{
 			title = "Change Front Sector's Tag";
 			prefix = "(410)";
-			flags8text = "[3] Set delay by backside sector";
 		}
-
 		416
 		{
 			title = "Start Adjustable Flickering Light";
 			prefix = "(416)";
-			flags8text = "[3] Set delay by backside sector";
-			flags64text = "[6] Second level from back";
 		}
-
 		417
 		{
 			title = "Start Adjustable Pulsating Light";
 			prefix = "(417)";
-			flags8text = "[3] Set delay by backside sector";
-			flags64text = "[6] Second level from back";
 		}
-
 		418
 		{
 			title = "Start Adjustable Blinking Light (unsynchronized)";
 			prefix = "(418)";
-			flags8text = "[3] Set delay by backside sector";
-			flags64text = "[6] Second level from back";
 		}
-
 		419
 		{
 			title = "Start Adjustable Blinking Light (synchronized)";
 			prefix = "(419)";
-			flags8text = "[3] Set delay by backside sector";
-			flags64text = "[6] Second level from back";
 		}
-
 		420
 		{
 			title = "Fade Light Level";
 			prefix = "(420)";
-			flags8text = "[3] Set delay by backside sector";
-			flags16text = "[4] Set params by X/Y offsets";
-			flags512text = "[9] Speed = Tic Duration";
-			flags1024text = "[10] Override existing fade";
 		}
-
 		421
 		{
 			title = "Stop Lighting Effect";
 			prefix = "(421)";
-			flags8text = "[3] Set delay by backside sector";
 		}
-
 		435
 		{
 			title = "Change Plane Scroller Direction";
 			prefix = "(435)";
-			flags8text = "[3] Set delay by backside sector";
 		}
 	}
 
@@ -1443,72 +815,46 @@ doom
 		{
 			title = "Move Tagged Sector's Floor";
 			prefix = "(403)";
-			flags2text = "[1] Trigger linedef executor";
-			flags8text = "[3] Set delay by backside sector";
-			flags64text = "[6] Change floor flat";
 		}
-
 		404
 		{
 			title = "Move Tagged Sector's Ceiling";
 			prefix = "(404)";
-			flags2text = "[1] Trigger linedef executor";
-			flags8text = "[3] Set delay by backside sector";
-			flags64text = "[6] Change ceiling flat";
 		}
-
 		405
 		{
 			title = "Move Floor According to Front Texture Offsets";
 			prefix = "(405)";
-			flags8text = "[3] Set delay by backside sector";
-			flags64text = "[6] Move instantly";
 		}
-
 		407
 		{
 			title = "Move Ceiling According to Front Texture Offsets";
 			prefix = "(407)";
-			flags8text = "[3] Set delay by backside sector";
-			flags64text = "[6] Move instantly";
 		}
-
 		411
 		{
 			title = "Stop Plane Movement";
 			prefix = "(411)";
-			flags8text = "[3] Set delay by backside sector";
 		}
-
 		428
 		{
 			title = "Start Platform Movement";
 			prefix = "(428)";
-			flags8text = "[3] Set delay by backside sector";
-			flags64text = "[6] Move upwards at start";
 		}
-
 		429
 		{
 			title = "Crush Ceiling Once";
 			prefix = "(429)";
-			flags8text = "[3] Set delay by backside sector";
-			flags512text = "[9] Double, constant speed";
 		}
-
 		430
 		{
 			title = "Crush Floor Once";
 			prefix = "(430)";
-			flags8text = "[3] Set delay by backside sector";
 		}
-
 		431
 		{
 			title = "Crush Floor and Ceiling Once";
 			prefix = "(431)";
-			flags8text = "[3] Set delay by backside sector";
-			flags512text = "[9] Double, constant speed";
 		}
 	}
 
@@ -1520,110 +866,72 @@ doom
 		{
 			title = "Teleporter";
 			prefix = "(412)";
-			flags2text = "[1] Silent";
-			flags8text = "[3] Set delay by backside sector";
-			flags64text = "[6] Retain angle";
-			flags256text = "[8] Relative, silent";
-			flags512text = "[9] Retain momentum";
 		}
-
 		425
 		{
 			title = "Change Object State";
 			prefix = "(425)";
-			flags8text = "[3] Set delay by backside sector";
 		}
-
 		426
 		{
 			title = "Stop Object";
 			prefix = "(426)";
-			flags8text = "[3] Set delay by backside sector";
-			flags64text = "[6] Teleport to sector center";
 		}
-
 		427
 		{
 			title = "Award Score";
 			prefix = "(427)";
-			flags8text = "[3] Set delay by backside sector";
 		}
-
 		432
 		{
 			title = "Enable/Disable 2D Mode";
 			prefix = "(432)";
-			flags8text = "[3] Set delay by backside sector";
-			flags64text = "[6] Return to 3D";
 		}
-
 		433
 		{
 			title = "Enable/Disable Gravity Flip";
 			prefix = "(433)";
-			flags8text = "[3] Set delay by backside sector";
-			flags64text = "[6] Return to normal";
 		}
-
 		434
 		{
 			title = "Award Power-Up";
 			prefix = "(434)";
-			flags2text = "[1] Use back upper texture";
-			flags8text = "[3] Set delay by backside sector";
-			flags64text = "[6] No time limit";
 		}
-
 		437
 		{
 			title = "Disable Player Control";
 			prefix = "(437)";
-			flags8text = "[3] Set delay by backside sector";
-			flags64text = "[6] Allow jumping";
 		}
-
 		438
 		{
 			title = "Change Object Size";
 			prefix = "(438)";
-			flags8text = "[3] Set delay by backside sector";
 		}
-
 		442
 		{
 			title = "Change Object Type State";
 			prefix = "(442)";
-			flags8text = "[3] Set delay by backside sector";
 		}
-
 		457
 		{
 			title = "Track Object's Angle";
 			prefix = "(457)";
-			flags8text = "[3] Set delay by backside sector";
-			flags128text = "[7] Don't stop after first fail";
 		}
-
 		458
 		{
 			title = "Stop Tracking Object's Angle";
 			prefix = "(458)";
-			flags8text = "[3] Set delay by backside sector";
 		}
-
 		460
 		{
 			title = "Award Rings";
 			prefix = "(460)";
 		}
-
 		461
 		{
 			title = "Spawn Object";
 			prefix = "(461)";
-			flags64text = "[6] Spawn inside a range";
 		}
-
 		462
 		{
 			title = "Stop Timer/Exit Stage in Record Attack";
@@ -1639,222 +947,126 @@ doom
 		{
 			title = "Change Music";
 			prefix = "(413)";
-			flags2text = "[1] Keep after death";
-			flags8text = "[3] Set delay by backside sector";
-			flags32text = "[5] Seek to current song position";
-			flags64text = "[6] For everyone";
-			flags128text = "[7] Fade to custom volume";
-			flags512text = "[9] Don't loop";
-			flags16384text = "[14] Force music reload";
 		}
-
 		414
 		{
 			title = "Play Sound Effect";
 			prefix = "(414)";
-			flags2text = "[1] From calling sector";
-			flags8text = "[3] Set delay by backside sector";
-			flags64text = "[6] From nowhere for triggerer";
-			flags512text = "[9] For everyone";
-			flags1024text = "[10] From tagged sectors";
 		}
-
 		415
 		{
 			title = "Run Script";
 			prefix = "(415)";
-			flags8text = "[3] Set delay by backside sector";
 		}
-
 		422
 		{
 			title = "Switch to Cut-Away View";
 			prefix = "(422)";
-			flags8text = "[3] Set delay by backside sector";
-			flags64text = "[6] Adjust pitch";
 		}
-
 		423
 		{
 			title = "Change Sky";
 			prefix = "(423)";
-			flags8text = "[3] Set delay by backside sector";
-			flags64text = "[6] For everyone";
 		}
-
 		424
 		{
 			title = "Change Weather";
 			prefix = "(424)";
-			flags8text = "[3] Set delay by backside sector";
-			flags64text = "[6] For everyone";
 		}
-
 		436
 		{
 			title = "Shatter FOF";
 			prefix = "(436)";
-			flags8text = "[3] Set delay by backside sector";
 		}
-
 		439
 		{
 			title = "Change Tagged Linedef's Textures";
 			prefix = "(439)";
-			flags8text = "[3] Set delay by backside sector";
-			flags64text = "[6] Only existing";
 		}
-
 		440
 		{
 			title = "Start Metal Sonic Race";
 			prefix = "(440)";
-			flags8text = "[3] Set delay by backside sector";
 		}
-
 		441
 		{
 			title = "Condition Set Trigger";
 			prefix = "(441)";
-			flags8text = "[3] Set delay by backside sector";
 		}
-
 		443
 		{
 			title = "Call Lua Function";
 			prefix = "(443)";
-			flags8text = "[3] Set delay by backside sector";
 		}
-
 		444
 		{
 			title = "Earthquake";
 			prefix = "(444)";
-			flags8text = "[3] Set delay by backside sector";
 		}
-
-
 		445
 		{
 			title = "Make FOF Disappear/Reappear";
 			prefix = "(445)";
-			flags8text = "[3] Set delay by backside sector";
-			flags64text = "[6] Reappear";
 		}
-
 		446
 		{
 			title = "Make FOF Crumble";
 			prefix = "(446)";
-			flags2text = "[1] Flags determine respawn";
-			flags8text = "[3] Set delay by backside sector";
-			flags64text = "[6] Don't respawn";
 		}
-
 		447
 		{
 			title = "Change Tagged Sector's Colormap";
 			prefix = "(447)";
-			flags8text = "[3] Set delay by backside sector";
-			flags16text = "[4] Front X/Y = Alpha";
-			flags32text = "[5] Subtract Red value";
-			flags64text = "[6] Subtract Green value";
-			flags128text = "[7] Subtract Blue value";
-			flags256text = "[8] Calc relative values";
-			flags32768text = "[15] Use back side colormap";
 		}
-
 		448
 		{
 			title = "Change Skybox";
 			prefix = "(448)";
-			flags2text = "[1] Change centerpoint";
-			flags8text = "[3] Set delay by backside sector";
-			flags64text = "[6] For everyone";
-			flags512text = "[9] Don't change viewpoint";
 		}
-
+		449
+		{
+			title = "Enable Bosses with Parameter";
+			prefix = "(449)";
+		}
 		450
 		{
 			title = "Execute Linedef Executor (specific tag)";
 			prefix = "(450)";
-			flags8text = "[3] Set delay by backside sector";
 		}
-
 		451
 		{
 			title = "Execute Linedef Executor (random tag in range)";
 			prefix = "(451)";
-			flags8text = "[3] Set delay by backside sector";
 		}
-
 		452
 		{
 			title = "Set FOF Translucency";
 			prefix = "(452)";
-			flags8text = "[3] Set delay by backside sector";
-			flags64text = "[6] Do not handle FF_TRANS";
-			flags256text = "[8] Set relative to current val";
 		}
-
 		453
 		{
 			title = "Fade FOF";
 			prefix = "(453)";
-			flags2text = "[1] Do not handle FF_EXISTS";
-			flags8text = "[3] Set delay by backside sector";
-			flags32text = "[5] No collision during fade";
-			flags64text = "[6] Do not handle FF_TRANS";
-			flags128text = "[7] Do not handle lighting";
-			flags256text = "[8] Set relative to current val";
-			flags512text = "[9] Speed = Tic Duration";
-			flags1024text = "[10] Override existing fade";
-			flags16384text = "[14] Do not handle collision";
-			flags32768text = "[15] Use exact alpha in OGL";
 		}
-
 		454
 		{
 			title = "Stop Fading FOF";
 			prefix = "(454)";
-			flags2text = "[1] Do not finalize collision";
-			flags8text = "[3] Set delay by backside sector";
 		}
-
 		455
 		{
 			title = "Fade Tagged Sector's Colormap";
 			prefix = "(455)";
-			flags8text = "[3] Set delay by backside sector";
-			flags16text = "[4] Front X/Y = Alpha";
-			flags32text = "[5] Subtract Red value";
-			flags64text = "[6] Subtract Green value";
-			flags128text = "[7] Subtract Blue value";
-			flags256text = "[8] Calc relative values";
-			flags512text = "[9] Speed = Tic Duration";
-			flags1024text = "[10] Override existing fade";
-			flags16384text = "[14] Fade from invisible black";
-			flags32768text = "[15] Use back side colormap";
 		}
-
 		456
 		{
 			title = "Stop Fading Tagged Sector's Colormap";
 			prefix = "(456)";
-			flags8text = "[3] Set delay by backside sector";
 		}
-
 		459
 		{
 			title = "Control Text Prompt";
 			prefix = "(459)";
-			flags2text = "[1] Close text prompt";
-			flags8text = "[3] Set delay by backside sector";
-			flags32text = "[5] Run executor tag on close";
-			flags64text = "[6] For everyone";
-			flags128text = "[7] Do not block controls";
-			flags256text = "[8] Do not freeze time";
-			flags32768text = "[15] Find prompt by name";
 		}
 	}
 
@@ -1866,113 +1078,66 @@ doom
 		{
 			title = "Door Slide";
 			prefix = "(480)";
-			flags8text = "[3] Set delay by backside sector";
 		}
-
 		481
 		{
 			title = "Door Swing";
 			prefix = "(481)";
-			flags8text = "[3] Set delay by backside sector";
 		}
-
 		482
 		{
 			title = "Move";
 			prefix = "(482)";
-			flags8text = "[3] Set delay by backside sector";
 		}
-
 		483
 		{
 			title = "Move, Override";
 			prefix = "(483)";
-			flags8text = "[3] Set delay by backside sector";
 		}
-
 		484
 		{
 			title = "Rotate Right";
 			prefix = "(484)";
-			flags8text = "[3] Set delay by backside sector";
-			flags64text = "[6] Don't turn players";
-			flags512text = "[9] Turn all objects";
 		}
-
 		485
 		{
 			title = "Rotate Right, Override";
 			prefix = "(485)";
-			flags8text = "[3] Set delay by backside sector";
-			flags64text = "[6] Don't turn players";
-			flags512text = "[9] Turn all objects";
 		}
-
 		486
 		{
 			title = "Rotate Left";
 			prefix = "(486)";
-			flags8text = "[3] Set delay by backside sector";
-			flags64text = "[6] Don't turn players";
-			flags512text = "[9] Turn all objects";
 		}
-
 		487
 		{
 			title = "Rotate Left, Override";
 			prefix = "(487)";
-			flags8text = "[3] Set delay by backside sector";
-			flags64text = "[6] Don't turn players";
-			flags512text = "[9] Turn all objects";
 		}
-
 		488
 		{
 			title = "Move by Waypoints";
 			prefix = "(488)";
-			flags8text = "[3] Set delay by backside sector";
-			flags32text = "[5] Reverse order";
-			flags128text = "[7] There and back";
-			flags256text = "[8] Return when done";
-			flags512text = "[9] Loop movement";
 		}
-
 		489
 		{
 			title = "Turn Invisible, Intangible";
 			prefix = "(489)";
-			flags8text = "[3] Set delay by backside sector";
-			flags64text = "[6] Only invisible";
 		}
-
 		490
 		{
 			title = "Turn Visible, Tangible";
 			prefix = "(490)";
-			flags8text = "[3] Set delay by backside sector";
-			flags64text = "[6] Only visible";
 		}
-
 		491
 		{
 			title = "Set Translucency";
 			prefix = "(491)";
-			flags8text = "[3] Set delay by backside sector";
-			flags16text = "[4] Set raw alpha by Front X";
-			flags256text = "[8] Calc relative values";
 		}
-
 		492
 		{
 			title = "Fade Translucency";
 			prefix = "(492)";
-			flags8text = "[3] Set delay by backside sector";
-			flags16text = "[4] Set raw alpha by Front X";
-			flags32text = "[5] No collision during fade";
-			flags256text = "[8] Calc relative values";
-			flags512text = "[9] Speed = Tic Duration";
-			flags1024text = "[10] Override existing fade";
-			flags16384text = "[14] Do not handle collision";
 		}
 	}
 
@@ -1985,37 +1150,31 @@ doom
 			title = "Scroll Wall Front Side Left";
 			prefix = "(500)";
 		}
-
 		501
 		{
 			title = "Scroll Wall Front Side Right";
 			prefix = "(501)";
 		}
-
 		502
 		{
 			title = "Scroll Wall According to Linedef";
 			prefix = "(502)";
 		}
-
 		503
 		{
 			title = "Scroll Wall According to Linedef (Accelerative)";
 			prefix = "(503)";
 		}
-
 		504
 		{
 			title = "Scroll Wall According to Linedef (Displacement)";
 			prefix = "(504)";
 		}
-
 		505
 		{
 			title = "Scroll Texture by Front Side Offsets";
 			prefix = "(505)";
 		}
-
 		506
 		{
 			title = "Scroll Texture by Back Side Offsets";
@@ -2032,107 +1191,86 @@ doom
 			title = "Scroll Floor Texture";
 			prefix = "(510)";
 		}
-
 		511
 		{
 			title = "Scroll Floor Texture (Accelerative)";
 			prefix = "(511)";
 		}
-
 		512
 		{
 			title = "Scroll Floor Texture (Displacement)";
 			prefix = "(512)";
 		}
-
 		513
 		{
 			title = "Scroll Ceiling Texture";
 			prefix = "(513)";
 		}
-
 		514
 		{
 			title = "Scroll Ceiling Texture (Accelerative)";
 			prefix = "(514)";
 		}
-
 		515
 		{
 			title = "Scroll Ceiling Texture (Displacement)";
 			prefix = "(515)";
 		}
-
 		520
 		{
 			title = "Carry Objects on Floor";
 			prefix = "(520)";
 		}
-
 		521
 		{
 			title = "Carry Objects on Floor (Accelerative)";
 			prefix = "(521)";
-			flags64text = "[6] Even across edges";
 		}
-
 		522
 		{
 			title = "Carry Objects on Floor (Displacement)";
 			prefix = "(522)";
 		}
-
 		523
 		{
 			title = "Carry Objects on Ceiling";
 			prefix = "(523)";
-			flags64text = "[6] Even across edges";
 		}
-
 		524
 		{
 			title = "Carry Objects on Ceiling (Accelerative)";
 			prefix = "(524)";
 		}
-
 		525
 		{
 			title = "Carry Objects on Ceiling (Displacement)";
 			prefix = "(525)";
 		}
-
 		530
 		{
 			title = "Scroll Floor Texture and Carry Objects";
 			prefix = "(530)";
-			flags64text = "[6] Even across edges";
 		}
-
 		531
 		{
 			title = "Scroll Floor Texture and Carry Objects (Accelerative)";
 			prefix = "(531)";
 		}
-
 		532
 		{
 			title = "Scroll Floor Texture and Carry Objects (Displacement)";
 			prefix = "(532)";
 		}
-
 		533
 		{
 			title = "Scroll Ceiling Texture and Carry Objects";
 			prefix = "(533)";
-			flags64text = "[6] Even across edges";
 		}
-
 		534
 		{
 			title = "Scroll Ceiling Texture and Carry Objects (Accelerative)";
 			prefix = "(534)";
 		}
-
 		535
 		{
 			title = "Scroll Ceiling Texture and Carry Objects (Displacement)";
@@ -2148,50 +1286,32 @@ doom
 		{
 			title = "Wind";
 			prefix = "(541)";
-			flags512text = "[9] Player slides";
-			flags64text = "[6] Even across edges";
 		}
-
 		542
 		{
 			title = "Upwards Wind";
 			prefix = "(542)";
-			flags512text = "[9] Player slides";
-			flags64text = "[6] Even across edges";
 		}
-
 		543
 		{
 			title = "Downwards Wind";
 			prefix = "(543)";
-			flags512text = "[9] Player slides";
-			flags64text = "[6] Even across edges";
 		}
-
 		544
 		{
 			title = "Current";
 			prefix = "(544)";
-			flags512text = "[9] Player slides";
-			flags64text = "[6] Even across edges";
 		}
-
 		545
 		{
 			title = "Upwards Current";
 			prefix = "(545)";
-			flags512text = "[9] Player slides";
-			flags64text = "[6] Even across edges";
 		}
-
 		546
 		{
 			title = "Downwards Current";
 			prefix = "(546)";
-			flags512text = "[9] Player slides";
-			flags64text = "[6] Even across edges";
 		}
-
 		547
 		{
 			title = "Push/Pull";
@@ -2208,37 +1328,31 @@ doom
 			title = "Floor Lighting";
 			prefix = "(600)";
 		}
-
 		601
 		{
 			title = "Ceiling Lighting";
 			prefix = "(601)";
 		}
-
 		602
 		{
 			title = "Adjustable Pulsating Light";
 			prefix = "(602)";
 		}
-
 		603
 		{
 			title = "Adjustable Flickering Light";
 			prefix = "(603)";
 		}
-
 		604
 		{
 			title = "Adjustable Blinking Light (unsynchronized)";
 			prefix = "(604)";
 		}
-
 		605
 		{
 			title = "Adjustable Blinking Light (synchronized)";
 			prefix = "(605)";
 		}
-
 		606
 		{
 			title = "Colormap";
@@ -2254,150 +1368,77 @@ doom
 		{
 			title = "Slope Frontside Floor";
 			prefix = "(700)";
-			flags2048text = "[11] No physics";
-			flags4096text = "[12] Dynamic";
-			slope = "regular";
-			slopeargs = 1;
 		}
-
 		701
 		{
 			title = "Slope Frontside Ceiling";
 			prefix = "(701)";
-			flags2048text = "[11] No physics";
-			flags4096text = "[12] Dynamic";
-			slope = "regular";
-			slopeargs = 2;
 		}
-
 		702
 		{
 			title = "Slope Frontside Floor and Ceiling";
 			prefix = "(702)";
-			flags2048text = "[11] No physics";
-			flags4096text = "[12] Dynamic";
-			slope = "regular";
-			slopeargs = 3;
 		}
-
 		703
 		{
 			title = "Slope Frontside Floor and Backside Ceiling";
 			prefix = "(703)";
-			flags2048text = "[11] No physics";
-			flags4096text = "[12] Dynamic";
-			slope = "regular";
-			slopeargs = 9;
-		}
-
+´		}
 		704
 		{
 			title = "Slope Frontside Floor by 3 Tagged Vertex Things";
 			prefix = "(704)";
-			flags2048text = "[11] No physics";
-			flags4096text = "[12] Dynamic";
-			flags8192text = "[13] Use tag and offsets";
-			slope = "vertex";
-			slopeargs = 0;
 		}
-
 		705
 		{
 			title = "Slope Frontside Ceiling by 3 Tagged Vertex Things";
 			prefix = "(705)";
-			flags2048text = "[11] No physics";
-			flags4096text = "[12] Dynamic";
-			flags8192text = "[13] Use tag and offsets";
-			slope = "vertex";
-			slopeargs = 1;
 		}
-
 		710
 		{
 			title = "Slope Backside Floor";
 			prefix = "(710)";
-			flags2048text = "[11] No physics";
-			flags4096text = "[12] Dynamic";
-			slope = "regular";
-			slopeargs = 4;
 		}
-
 		711
 		{
 			title = "Slope Backside Ceiling";
 			prefix = "(711)";
-			flags2048text = "[11] No physics";
-			flags4096text = "[12] Dynamic";
-			slope = "regular";
-			slopeargs = 8;
 		}
-
 		712
 		{
 			title = "Slope Backside Floor and Ceiling";
 			prefix = "(712)";
-			flags2048text = "[11] No physics";
-			flags4096text = "[12] Dynamic";
-			slope = "regular";
-			slopeargs = 12;
 		}
-
 		713
 		{
 			title = "Slope Backside Floor and Frontside Ceiling";
 			prefix = "(713)";
-			flags2048text = "[11] No physics";
-			flags4096text = "[12] Dynamic";
-			slope = "regular";
-			slopeargs = 6;
 		}
-
 		714
 		{
 			title = "Slope Backside Floor by 3 Tagged Vertex Things";
 			prefix = "(714)";
-			flags2048text = "[11] No physics";
-			flags4096text = "[12] Dynamic";
-			flags8192text = "[13] Use tag and offsets";
-			slope = "vertex";
-			slopeargs = 2;
 		}
-
 		715
 		{
 			title = "Slope Backside Ceiling by 3 Tagged Vertex Things";
 			prefix = "(715)";
-			flags2048text = "[11] No physics";
-			flags4096text = "[12] Dynamic";
-			flags8192text = "[13] Use tag and offsets";
-			slope = "vertex";
-			slopeargs = 3;
 		}
-
 		720
 		{
 			title = "Copy Frontside Floor Slope from Line Tag";
 			prefix = "(720)";
-			slope = "copy";
-			slopeargs = 1;
 		}
-
 		721
 		{
 			title = "Copy Frontside Ceiling Slope from Line Tag";
 			prefix = "(721)";
-			slope = "copy";
-			slopeargs = 2;
 		}
-
 		722
 		{
 			title = "Copy Frontside Floor and Ceiling Slope from Line Tag";
 			prefix = "(722)";
-			slope = "copy";
-			slopeargs = 3;
 		}
-
 		799
 		{
 			title = "Set Tagged Dynamic Slope Vertex to Front Sector Height";
@@ -2414,55 +1455,46 @@ doom
 			title = "90% Opaque";
 			prefix = "(900)";
 		}
-
 		901
 		{
 			title = "80% Opaque";
 			prefix = "(901)";
 		}
-
 		902
 		{
 			title = "70% Opaque";
 			prefix = "(902)";
 		}
-
 		903
 		{
 			title = "60% Opaque";
 			prefix = "(903)";
 		}
-
 		904
 		{
 			title = "50% Opaque";
 			prefix = "(904)";
 		}
-
 		905
 		{
 			title = "40% Opaque";
 			prefix = "(905)";
 		}
-
 		906
 		{
 			title = "30% Opaque";
 			prefix = "(906)";
 		}
-
 		907
 		{
 			title = "20% Opaque";
 			prefix = "(907)";
 		}
-
 		908
 		{
 			title = "10% Opaque";
 			prefix = "(908)";
 		}
-
 		909
 		{
 			title = "Fog Wall";
@@ -2484,6 +1516,204 @@ udmf
 		}
 	}
 
+	fof
+	{
+		title = "FOF";
+
+		100
+		{
+			title = "Solid";
+			prefix = "(100)";
+			arg0
+			{
+				title = "Target sector tag";
+				type = 13;
+			}
+			arg1
+			{
+				title = "Visibility";
+				type = 12;
+				enum
+				{
+					1 = "Don't render planes";
+					2 = "Don't render sides";
+				}
+			}
+			arg2
+			{
+				title = "Translucency";
+				type = 11;
+				enum
+				{
+					0 = "Opaque";
+					1 = "Translucent, no insides";
+					2 = "Translucent, render insides";
+				}
+			}
+			arg3
+			{
+				title = "Tangibility";
+				type = 12;
+				enum = "tangibility";
+			}
+			arg4
+			{
+				title = "Cast shadow?";
+				type = 11;
+				enum = "yesno";
+			}
+		}
+
+		120
+		{
+			title = "Water";
+			prefix = "(120)";
+			arg0
+			{
+				title = "Target sector tag";
+				type = 13;
+			}
+			arg1
+			{
+				title = "Flags";
+				type = 12;
+				enum
+				{
+				    1 = "Opaque";
+					2 = "Don't render sides";
+					4 = "Render separate light level";
+					8 = "Use target light level";
+					16 = "No ripple effect";
+					32 = "Goo physics";
+				}
+			}
+		}
+	}
+
+	linedefexecmisc
+	{
+		title = "Linedef Executor (misc.)";
+
+		443
+		{
+			title = "Call Lua Function";
+			prefix = "(443)";
+			stringarg0
+			{
+				title = "Function name";
+				type = 2;
+			}
+		}
+
+		447
+		{
+			title = "Change Tagged Sector's Colormap";
+			prefix = "(447)";
+			arg0
+			{
+				title = "Target sector tag";
+				type = 13;
+			}
+			arg1
+			{
+				title = "Colormap sector tag";
+				type = 13;
+			}
+			arg2
+			{
+				title = "Flags";
+				type = 12;
+				enum
+				{
+					1 = "Add to existing colormap";
+					2 = "Subtract light R";
+					4 = "Subtract light G";
+					8 = "Subtract light B";
+					16 = "Subtract light A";
+					32 = "Subtract light R";
+					64 = "Subtract fade G";
+					128 = "Subtract fade B";
+					256 = "Subtract fade A";
+					512 = "Subtract fadestart";
+					1024 = "Subtract fadeend";
+					2048 = "Ignore flags";
+				}
+			}
+		}
+
+		455
+		{
+			title = "Fade Tagged Sector's Colormap";
+			prefix = "(455)";
+			arg0
+			{
+				title = "Target sector tag";
+				type = 13;
+			}
+			arg1
+			{
+				title = "Colormap sector tag";
+				type = 13;
+			}
+			arg2
+			{
+				title = "Fade duration";
+			}
+			arg3
+			{
+				title = "Flags";
+				type = 12;
+				enum
+				{
+					1 = "Add to existing colormap";
+					2 = "Subtract light R";
+					4 = "Subtract light G";
+					8 = "Subtract light B";
+					16 = "Subtract light A";
+					32 = "Subtract light R";
+					64 = "Subtract fade G";
+					128 = "Subtract fade B";
+					256 = "Subtract fade A";
+					512 = "Subtract fadestart";
+					1024 = "Subtract fadeend";
+					2048 = "Ignore flags";
+					4096 = "Fade from invisible black";
+					8192 = "Interrupt ongoing fades";
+				}
+			}
+		}
+
+		456
+		{
+			title = "Stop Fading Tagged Sector's Colormap";
+			prefix = "(456)";
+			arg0
+			{
+				title = "Target sector tag";
+				type = 13;
+			}
+		}
+	}
+
+	light
+	{
+		606
+		{
+			title = "Copy Colormap";
+			prefix = "(606)";
+			arg0
+			{
+				title = "Target sector tag";
+				type = 13;
+			}
+			arg1
+			{
+				title = "Colormap sector tag";
+				type = 13;
+			}
+		}
+	}
+
 	slope
 	{
 		title = "Slope";
@@ -2493,7 +1723,6 @@ udmf
 			title = "Create Sector-Based Slope";
 			prefix = "(700)";
 			id = "plane_align";
-			slope = "regular";
 			arg0
 			{
 				title = "Floor";
@@ -2522,7 +1751,6 @@ udmf
 		{
 			title = "Create Vertex-Based Slope";
 			prefix = "(704)";
-			slope = "vertex";
 			arg0
 			{
 				title = "Plane";
@@ -2538,14 +1766,17 @@ udmf
 			arg1
 			{
 				title = "Vertex 1 tag";
+				type = 14;
 			}
 			arg2
 			{
 				title = "Vertex 2 tag";
+				type = 14;
 			}
 			arg3
 			{
 				title = "Vertex 3 tag";
+				type = 14;
 			}
 			arg4
 			{
@@ -2563,7 +1794,6 @@ udmf
 		{
 			title = "Copy Slope";
 			prefix = "(720)";
-			slope = "copy";
 			arg0
 			{
 				title = "Front floor tag";
diff --git a/extras/conf/Includes/SRB222_misc.cfg b/extras/conf/Includes/SRB222_misc.cfg
index cb82d4371f3a5a86d1a39be42ea248e2e690c708..bf8768d2aab41506ed407abe2a9b82733f7c8907 100644
--- a/extras/conf/Includes/SRB222_misc.cfg
+++ b/extras/conf/Includes/SRB222_misc.cfg
@@ -19,13 +19,6 @@ linedefflags
 }
 
 
-// LINEDEF ACTIVATIONS
-// Make sure these are in order from lowest value to highest value
-linedefactivations
-{
-}
-
-
 // Linedef flags UDMF translation table
 // This is needed for copy/paste and prefabs to work properly
 // When the UDMF field name is prefixed with ! it is inverted
@@ -63,44 +56,24 @@ linedefflags_udmf
 	midpeg = "Peg Midtexture";
 	midsolid = "Solid Midtexture";
 	wrapmidtex = "Repeat Midtexture";
-//	netonly = "Netgame Only";
-//	nonet = "No Netgame";
+	netonly = "Netgame Only";
+	nonet = "No Netgame";
 	effect6 = "Effect 6";
 	bouncy = "Bouncy Wall";
 	transfer = "Transfer Line";
 }
 
-
-linedefactivations_udmf
-{
-//	notriggerorder = "Out of Order";
-	netonly = "Netgame Only";
-	nonet = "No Netgame";
-}
-
-sidedefflags
-{
-	clipmidtex = "Clip middle texture";
-	wrapmidtex = "Wrap middle texture";
-	smoothlighting = "Smooth lighting";
-	nofakecontrast = "Even lighting";
-	nodecals = "No decals";
-	lightfog = "Use sidedef brightness on fogged walls";
-}
-
-//RENDER STYLES
-thingrenderstyles
-{
-}
-
-linedefrenderstyles
+/*linedefrenderstyles
 {
 	translucent = "Translucent";
 	fog = "Fog";
-}
+}*/
 
-sectorrenderstyles
+sectorflags
 {
+	colormapfog = "Fog Planes in Colormap";
+	colormapfadesprites = "Fade Fullbright in Colormap";
+	colormapprotected = "Protected Colormap";
 }
 
 thingflags
@@ -116,7 +89,7 @@ thingflags_udmf
 {
 	extra = "Extra";
 	flip = "Flip";
-	objectspecial = "Special";
+	special = "Special";
 	ambush = "Ambush";
 }
 
@@ -128,7 +101,7 @@ thingflagstranslation
 {
 	1 = "extra";
 	2 = "flip";
-	4 = "objectspecial";
+	4 = "special";
 	8 = "ambush";
 }
 
@@ -221,27 +194,25 @@ universalfields
 {
 	sector
 	{
-		friction
+		lightalpha
 		{
-			name = "Friction";
-			type = 1;
-			default = 1;
+			type = 0;
+			default = 25;
 		}
 
-		specialeffectplanes
+		fadealpha
 		{
-			type = 11;
-			enum = "floorceiling";
-			default = 0;
+			type = 0;
+			default = 25;
 		}
 
-		colormapbegin
+		fadestart
 		{
 			type = 0;
 			default = 0;
 		}
 
-		colormapend
+		fadeend
 		{
 			type = 0;
 			default = 33;
@@ -252,63 +223,34 @@ universalfields
 			type = 3;
 			default = false;
 		}
+	}
 
-		teambase
-		{
-			type = 11;
-			enum = "ctfteam";
-			default = 0;
-		}
-
-		triggersector
-		{
-			type = 3;
-			default = false;
-		}
-
-		triggerobject
+	linedef
+	{
+		arg5
 		{
-			type = 11;
-			enum = "triggerobjects";
+			type = 0;
 			default = 0;
 		}
-
-		triggersurface
+		stringarg0
 		{
-			type = 11;
-			enum = "triggersurfaces";
-			default = 0;
+			type = 2;
+			default = "";
 		}
-
-		ringdrain
+		stringarg1
 		{
-			type = 1;
-			default = 0;
+			type = 2;
+			default = "";
 		}
 	}
 
-	linedef
+	sidedef
 	{
-		executordelay
-		{
-			type = 0;
-			default = 0;
-		}
-		midtexrepetitions
-		{
-			type = 0;
-			default = 0;
-		}
-		arg5
+		repeatcnt
 		{
 			type = 0;
 			default = 0;
 		}
-		arg1str
-		{
-			type = 2;
-			default = "";
-		}
 	}
 
 	thing
@@ -483,27 +425,6 @@ enums
 		1 = "Up";
 	}
 
-	addset
-	{
-		0 = "Add";
-		1 = "Set";
-	}
-
-	floorceiling
-	{
-		0 = "Floor";
-		1 = "Ceiling";
-		2 = "Floor and ceiling";
-	}
-
-	triggertype
-	{
-		0 = "Continuous";
-		1 = "Each Time (Enter)";
-		2 = "Each Time (Enter and leave)";
-		3 = "Once";
-	}
-
 	frontback
 	{
 		0 = "None";
@@ -511,29 +432,6 @@ enums
 		2 = "Back";
 	}
 
-	ctfteam
-	{
-		0 = "None";
-		1 = "Red";
-		2 = "Blue";
-	}
-
-	triggerobjects
-	{
-		0 = "Any player";
-		1 = "All players";
-		2 = "Pushable object";
-		3 = "Any object with thinker";
-	}
-
-	triggersurfaces
-	{
-		0 = "Floor touch";
-		1 = "Ceiling touch";
-		2 = "Floor or ceiling touch";
-		3 = "Anywhere in sector";
-	}
-
 	tangibility
 	{
 		1 = "Intangible from top";
@@ -601,10 +499,6 @@ thingsfilters
 	}
 }
 
-thingsfilters_udmf
-{
-}
-
 // Special linedefs
 speciallinedefs
 {
diff --git a/extras/conf/Includes/SRB222_sectors.cfg b/extras/conf/Includes/SRB222_sectors.cfg
index 3bcbeb1b14d8ac6466f79e888a5be7ef3aa9bc24..5cc14ad0fb1a6b58c7d9ab29e23045b4a7ff8b1e 100644
--- a/extras/conf/Includes/SRB222_sectors.cfg
+++ b/extras/conf/Includes/SRB222_sectors.cfg
@@ -25,7 +25,7 @@ sectortypes
 	112 = "Trigger Line Ex. (NiGHTS Mare)";
 	128 = "Check for Linedef Executor on FOFs";
 	144 = "Egg Capsule";
-	160 = "Special Stage Time/Rings Parameters";
+	160 = "Special Stage Time/Spheres Parameters";
 	176 = "Custom Global Gravity";
 	512 = "Wind/Current";
 	1024 = "Conveyor Belt";
@@ -78,7 +78,7 @@ gen_sectortypes
 		112 = "Trigger Line Ex. (NiGHTS Mare)";
 		128 = "Check for Linedef Executor on FOFs";
 		144 = "Egg Capsule";
-		160 = "Special Stage Time/Rings Parameters";
+		160 = "Special Stage Time/Spheres Parameters";
 		176 = "Custom Global Gravity";
 	}
 
diff --git a/extras/conf/Includes/SRB222_things.cfg b/extras/conf/Includes/SRB222_things.cfg
index 194e43630b70f5f98b6a3963b4b27371c85d2e02..d0af9be20bdc71b2cfe57fda8f9a3ee82fc9cca6 100644
--- a/extras/conf/Includes/SRB222_things.cfg
+++ b/extras/conf/Includes/SRB222_things.cfg
@@ -23,7 +23,6 @@ starts
 	title = "Player Starts";
 	width = 16;
 	height = 48;
-	flags8text = "[8] Spawn on ceiling";
 	sprite = "PLAYA0";
 
 	1
@@ -229,7 +228,6 @@ enemies
 		sprite = "FISHA0";
 		width = 8;
 		height = 28;
-		angletext = "Jump strength";
 	}
 	103
 	{
@@ -237,7 +235,6 @@ enemies
 		sprite = "BUZZA1";
 		width = 28;
 		height = 40;
-		flags8text = "[8] Cannot move";
 	}
 	104
 	{
@@ -245,7 +242,6 @@ enemies
 		sprite = "RBUZA1";
 		width = 28;
 		height = 40;
-		flags8text = "[8] Cannot move";
 	}
 	108
 	{
@@ -267,7 +263,6 @@ enemies
 		sprite = "TURRI1";
 		width = 12;
 		height = 64;
-		angletext = "Firing delay";
 	}
 	122
 	{
@@ -303,7 +298,6 @@ enemies
 		sprite = "CRABA0";
 		width = 24;
 		height = 32;
-		flags8text = "[8] Move left from spawn";
 	}
 	138
 	{
@@ -311,7 +305,6 @@ enemies
 		sprite = "CR2BA0";
 		width = 24;
 		height = 32;
-		flags8text = "[8] Move left from spawn";
 	}
 	117
 	{
@@ -340,9 +333,6 @@ enemies
 		sprite = "ESHIA1";
 		width = 16;
 		height = 48;
-		flags1text = "[1] 90 degrees counter-clockwise";
-		flags4text = "[4] 90 degrees clockwise";
-		flags8text = "[8] Double speed";
 	}
 	115
 	{
@@ -386,7 +376,6 @@ enemies
 		sprite = "PTERA2A8";
 		width = 16;
 		height = 16;
-		parametertext = "No. Pterabytes";
 	}
 	136
 	{
@@ -394,7 +383,6 @@ enemies
 		sprite = "PYREA0";
 		width = 24;
 		height = 34;
-		flags8text = "[8] Start on fire";
 	}
 	137
 	{
@@ -409,7 +397,6 @@ enemies
 		sprite = "JETBB1";
 		width = 20;
 		height = 50;
-		flags8text = "[8] Cannot move";
 	}
 	106
 	{
@@ -417,7 +404,6 @@ enemies
 		sprite = "JETGB1";
 		width = 20;
 		height = 48;
-		flags8text = "[8] Cannot move";
 	}
 	112
 	{
@@ -467,7 +453,6 @@ enemies
 		sprite = "CACOA0";
 		width = 32;
 		height = 32;
-		flags8text = "[8] Cannot move";
 	}
 	133
 	{
@@ -483,7 +468,6 @@ enemies
 		sprite = "HIVEA0";
 		width = 32;
 		height = 80;
-		parametertext = "No. bees";
 	}
 	128
 	{
@@ -520,8 +504,6 @@ bosses
 		sprite = "EGGMA1";
 		width = 24;
 		height = 76;
-		flags4text = "[4] End level on death";
-		flags8text = "[8] Alternate laser attack";
 	}
 	201
 	{
@@ -529,8 +511,6 @@ bosses
 		sprite = "EGGNA1";
 		width = 24;
 		height = 76;
-		flags4text = "[4] End level on death";
-		flags8text = "[8] Speed up when hit";
 	}
 	202
 	{
@@ -538,7 +518,6 @@ bosses
 		sprite = "EGGOA1";
 		width = 32;
 		height = 116;
-		flags4text = "[4] End level on death";
 	}
 	203
 	{
@@ -546,7 +525,6 @@ bosses
 		sprite = "EGGPA1";
 		width = 24;
 		height = 76;
-		flags4text = "[4] End level on death";
 	}
 	204
 	{
@@ -554,8 +532,6 @@ bosses
 		sprite = "FANGA1";
 		width = 24;
 		height = 60;
-		flags1text = "[1] Grayscale mode";
-		flags4text = "[4] End level on death";
 	}
 	206
 	{
@@ -563,7 +539,6 @@ bosses
 		sprite = "BRAKB1";
 		width = 48;
 		height = 160;
-		flags4text = "[4] End level on death";
 	}
 	207
 	{
@@ -571,7 +546,6 @@ bosses
 		sprite = "METLI1";
 		width = 16;
 		height = 48;
-		flags1text = "[1] Grayscale mode";
 	}
 	208
 	{
@@ -579,8 +553,6 @@ bosses
 		sprite = "METLC1";
 		width = 16;
 		height = 48;
-		flags1text = "[1] Grayscale mode";
-		flags4text = "[4] End level on death";
 	}
 	209
 	{
@@ -588,9 +560,6 @@ bosses
 		sprite = "BRAK01";
 		width = 48;
 		height = 160;
-		flags1text = "[1] No origin-fling death";
-		flags4text = "[4] End level on death";
-		flags8text = "[8] Electric barrier";
 	}
 	290
 	{
@@ -614,11 +583,7 @@ bosses
 		title = "Boss Waypoint";
 		width = 8;
 		height = 16;
-		flags8text = "[8] Sea Egg shooting point";
 		sprite = "internal:eggmanway";
-		angletext = "No. (Sea Egg)";
-		flagsvaluetext = "No. (Brak)";
-		parametertext = "Next";
 	}
 	293
 	{
@@ -630,7 +595,6 @@ bosses
 	294
 	{
 		title = "Fang Waypoint";
-		flags8text = "[8] Center waypoint";
 		sprite = "internal:eggmanway";
 		width = 8;
 		height = 16;
@@ -643,8 +607,6 @@ rings
 	title = "Rings and Weapon Panels";
 	width = 24;
 	height = 24;
-	flags8height = 24;
-	flags8text = "[8] Float";
 	sprite = "RINGA0";
 
 	300
@@ -761,8 +723,6 @@ collectibles
 		sprite = "TOKEA0";
 		width = 16;
 		height = 32;
-		flags8height = 24;
-		flags8text = "[8] Float";
 	}
 	313
 	{
@@ -808,8 +768,6 @@ collectibles
 	{
 		title = "Match Chaos Emerald Spawn";
 		sprite = "CEMGA0";
-		flags8height = 24;
-		flags8text = "[8] Float";
 	}
 	322
 	{
@@ -817,9 +775,6 @@ collectibles
 		sprite = "EMBMA0";
 		width = 16;
 		height = 30;
-		flags8height = 24;
-		flags8text = "[8] Float";
-		angletext = "Tag";
 	}
 }
 
@@ -830,9 +785,6 @@ boxes
 	title = "Monitors";
 	width = 18;
 	height = 40;
-	flags1text = "[1] Run Linedef Executor on pop";
-	flags4text = "[4] Random (Strong)";
-	flags8text = "[8] Random (Weak)";
 
 	400
 	{
@@ -883,15 +835,11 @@ boxes
 	{
 		title = "Extra Life";
 		sprite = "TV1UA0";
-		flags4text = "[4] Random (Strong) / 10k points";
-		flags8text = "[8] Random (Weak) / 10k points";
 	}
 	410
 	{
 		title = "Eggman";
 		sprite = "TVEGA0";
-		flags4text = "[4] Special";
-		flags8text = "[8] Ambush";
 	}
 	411
 	{
@@ -902,22 +850,16 @@ boxes
 	{
 		title = "Gravity Boots";
 		sprite = "TVGVA0";
-		flags4text = "[4] Special";
-		flags8text = "[8] Ambush";
 	}
 	414
 	{
 		title = "CTF Team Ring Monitor (Red)";
 		sprite = "TRRIA0";
-		flags4text = "[4] Special";
-		flags8text = "[8] Ambush";
 	}
 	415
 	{
 		title = "CTF Team Ring Monitor (Blue)";
 		sprite = "TBRIA0";
-		flags4text = "[4] Special";
-		flags8text = "[8] Ambush";
 	}
 	416
 	{
@@ -928,15 +870,11 @@ boxes
 	{
 		title = "Score (1,000 Points)";
 		sprite = "TV1KA0";
-		flags4text = "[4] Special";
-		flags8text = "[8] Ambush";
 	}
 	419
 	{
 		title = "Score (10,000 Points)";
 		sprite = "TVTKA0";
-		flags4text = "[4] Special";
-		flags8text = "[8] Ambush";
 	}
 	420
 	{
@@ -962,7 +900,6 @@ boxes2
 	title = "Monitors (Respawning)";
 	width = 20;
 	height = 44;
-	flags1text = "[1] Run Linedef Executor on pop";
 
 	431
 	{
@@ -1042,7 +979,6 @@ generic
 		sprite = "BUBLE0";
 		width = 8;
 		height = 16;
-		flags8text = "[8] No distance check";
 	}
 	501
 	{
@@ -1058,7 +994,6 @@ generic
 		sprite = "STPTA0M0";
 		width = 64;
 		height = 128;
-		angletext = "Angle/Order";
 	}
 	520
 	{
@@ -1066,9 +1001,6 @@ generic
 		sprite = "SPHRD0";
 		width = 16;
 		height = 24;
-		flags8height = 24;
-		flags8text = "[8] Float";
-		unflippable = true;
 	}
 	521
 	{
@@ -1076,8 +1008,6 @@ generic
 		sprite = "SPIKA0";
 		width = 12;
 		height = 8;
-		flags8height = 24;
-		flags8text = "[8] Float";
 	}
 	522
 	{
@@ -1085,10 +1015,6 @@ generic
 		sprite = "WSPKALAR";
 		width = 16;
 		height = 14;
-		flags1text = "[1] Start retracted";
-		flags4text = "[4] Retractable";
-		flags8text = "[8] Intangible";
-		parametertext = "Initial delay";
 	}
 	523
 	{
@@ -1096,11 +1022,6 @@ generic
 		sprite = "USPKA0";
 		width = 8;
 		height = 32;
-		flags1text = "[1] Start retracted";
-		flags4text = "[4] Retractable";
-		flags8text = "[8] Intangible";
-		angletext = "Retraction interval";
-		parametertext = "Initial delay";
 	}
 	1130
 	{
@@ -1146,15 +1067,11 @@ springs
 		sprite = "FANSA0D0";
 		width = 16;
 		height = 8;
-		flags4text = "[4] Invisible";
-		flags8text = "[8] No distance check";
-		angletext = "Lift height";
 	}
 	541
 	{
 		title = "Gas Jet";
 		sprite = "STEMD0";
-		flags8text = "[8] No sounds";
 		width = 32;
 	}
 	542
@@ -1163,7 +1080,6 @@ springs
 		sprite = "BUMPA0";
 		width = 32;
 		height = 64;
-		angletext = "Strength";
 	}
 	543
 	{
@@ -1171,8 +1087,6 @@ springs
 		sprite = "BLONA0";
 		width = 32;
 		height = 64;
-		flags8text = "[8] Respawn";
-		angletext = "Color";
 	}
 	550
 	{
@@ -1195,8 +1109,6 @@ springs
 		title = "Diagonal Yellow Spring";
 		sprite = "YSPRD2";
 		width = 16;
-		flags4text = "[4] Ignore gravity";
-		flags8text = "[8] Rotate 22.5° CCW";
 	}
 	556
 	{
@@ -1204,8 +1116,6 @@ springs
 		title = "Diagonal Red Spring";
 		sprite = "RSPRD2";
 		width = 16;
-		flags4text = "[4] Ignore gravity";
-		flags8text = "[8] Rotate 22.5° CCW";
 	}
 	557
 	{
@@ -1213,16 +1123,12 @@ springs
 		title = "Diagonal Blue Spring";
 		sprite = "BSPRD2";
 		width = 16;
-		flags4text = "[4] Ignore gravity";
-		flags8text = "[8] Rotate 22.5° CCW";
 	}
 	558
 	{
 		arrow = 1;
 		title = "Horizontal Yellow Spring";
 		sprite = "SSWYD2D8";
-		flags8height = 16;
-		flags8text = "[8] Float";
 		width = 16;
 		height = 32;
 	}
@@ -1231,8 +1137,6 @@ springs
 		arrow = 1;
 		title = "Horizontal Red Spring";
 		sprite = "SSWRD2D8";
-		flags8height = 16;
-		flags8text = "[8] Float";
 		width = 16;
 		height = 32;
 	}
@@ -1241,8 +1145,6 @@ springs
 		arrow = 1;
 		title = "Horizontal Blue Spring";
 		sprite = "SSWBD2D8";
-		flags8height = 16;
-		flags8text = "[8] Float";
 		width = 16;
 		height = 32;
 	}
@@ -1265,7 +1167,6 @@ springs
 		arrow = 1;
 		title = "Yellow Boost Panel";
 		sprite = "BSTYA0";
-		flags8text = "[8] Force spin";
 		width = 28;
 		height = 2;
 	}
@@ -1274,7 +1175,6 @@ springs
 		arrow = 1;
 		title = "Red Boost Panel";
 		sprite = "BSTRA0";
-		flags8text = "[8] Force spin";
 		width = 28;
 		height = 2;
 	}
@@ -1320,16 +1220,12 @@ patterns
 		sprite = "RINGA0";
 		width = 96;
 		height = 192;
-		unflippable = true;
-		centerHitbox = true;
 	}
 	605
 	{
 		title = "Circle of Rings (Big)";
 		sprite = "RINGA0";
 		width = 192;
-		unflippable = true;
-		centerHitbox = true;
 	}
 	606
 	{
@@ -1337,16 +1233,12 @@ patterns
 		sprite = "SPHRA0";
 		width = 96;
 		height = 192;
-		unflippable = true;
-		centerHitbox = true;
 	}
 	607
 	{
 		title = "Circle of Blue Spheres (Big)";
 		sprite = "SPHRA0";
 		width = 192;
-		unflippable = true;
-		centerHitbox = true;
 	}
 	608
 	{
@@ -1354,16 +1246,11 @@ patterns
 		sprite = "SPHRA0";
 		width = 96;
 		height = 192;
-		unflippable = true;
-		centerHitbox = true;
-	}
 	609
 	{
 		title = "Circle of Rings and Spheres (Big)";
 		sprite = "SPHRA0";
 		width = 192;
-		unflippable = true;
-		centerHitbox = true;
 	}
 }
 
@@ -1448,7 +1335,6 @@ invisible
 	{
 		title = "Slope Vertex";
 		sprite = "internal:vertexslope";
-		angletext = "Tag";
 	}
 
 	751
@@ -1469,24 +1355,17 @@ invisible
 	{
 		title = "Zoom Tube Waypoint";
 		sprite = "internal:zoom";
-		angletext = "Order";
 	}
 
 	754
 	{
 		title = "Push Point";
-		flags4text = "[4] Fades using XY";
-		flags8text = "[8] Push using XYZ";
 		sprite = "GWLGA0";
-		angletext = "Radius";
 	}
 	755
 	{
 		title = "Pull Point";
-		flags4text = "[4] Fades using XY";
-		flags8text = "[8] Pull using XYZ";
 		sprite = "GWLRA0";
-		angletext = "Radius";
 	}
 	756
 	{
@@ -1501,7 +1380,6 @@ invisible
 		sprite = "PRTLA0";
 		width = 8;
 		height = 16;
-		angletext = "Tag";
 	}
 	758
 	{
@@ -1512,28 +1390,21 @@ invisible
 	{
 		title = "PolyObject Anchor";
 		sprite = "internal:polyanchor";
-		angletext = "ID";
 	}
-
 	761
 	{
 		title = "PolyObject Spawn Point";
 		sprite = "internal:polycenter";
-		angletext = "ID";
 	}
-
 	762
 	{
 		title = "PolyObject Spawn Point (Crush)";
 		sprite = "internal:polycentercrush";
-		angletext = "ID";
 	}
 	780
 	{
 		title = "Skybox View Point";
 		sprite = "internal:skyb";
-		flags4text = "[4] In-map centerpoint";
-		parametertext = "ID";
 	}
 }
 
@@ -1699,8 +1570,6 @@ deepsea
 		sprite = "GARGA1";
 		width = 16;
 		height = 40;
-		flags4text = "[4] Slides when pushed";
-		flags8text = "[8] Not pushable";
 	}
 	1009
 	{
@@ -1710,8 +1579,6 @@ deepsea
 		sprite = "GARGB1";
 		width = 32;
 		height = 80;
-		flags4text = "[4] Slides when pushed";
-		flags8text = "[8] Not pushable";
 	}
 	1001
 	{
@@ -1727,7 +1594,6 @@ deepsea
 		width = 8;
 		height = 16;
 		hangs = 1;
-		angletext = "Dripping interval";
 	}
 	1003
 	{
@@ -1763,7 +1629,6 @@ deepsea
 		sprite = "KELPA0";
 		width = 16;
 		height = 292;
-		flags4text = "[4] Double size";
 	}
 	1008
 	{
@@ -1771,7 +1636,6 @@ deepsea
 		sprite = "DSTGA0";
 		width = 8;
 		height = 116;
-		flags4text = "[4] Double size";
 	}
 	1010
 	{
@@ -1787,7 +1651,6 @@ deepsea
 		sprite = "DSTGA0";
 		width = 8;
 		height = 116;
-		flags4text = "[4] Double size";
 	}
 	1012
 	{
@@ -1839,7 +1702,6 @@ castleeggman
 		sprite = "FLAMA0E0";
 		width = 8;
 		height = 32;
-		flags1text = "[1] Add corona";
 	}
 	1102
 	{
@@ -1849,9 +1711,6 @@ castleeggman
 		sprite = "ESTAA1";
 		width = 32;
 		height = 240;
-		flags1text = "[1] Solid gold";
-		flags4text = "[4] Slides when pushed";
-		flags8text = "[8] Not pushable";
 	}
 	1103
 	{
@@ -1866,9 +1725,6 @@ castleeggman
 		sprite = "SMCEA0";
 		width = 17;
 		height = 34;
-		flags4text = "[4] No sounds";
-		flags8text = "[8] Double size";
-		angletext = "Tag";
 	}
 	1105
 	{
@@ -1876,9 +1732,6 @@ castleeggman
 		sprite = "SMCEA0";
 		width = 17;
 		height = 34;
-		flags4text = "[4] No sounds";
-		flags8text = "[8] Double size";
-		angletext = "Tag";
 	}
 	1106
 	{
@@ -1886,9 +1739,6 @@ castleeggman
 		sprite = "YSPBA0";
 		width = 17;
 		height = 34;
-		flags4text = "[4] No sounds";
-		flags8text = "[8] Red spring";
-		angletext = "Tag";
 	}
 	1107
 	{
@@ -1896,8 +1746,6 @@ castleeggman
 		sprite = "BMCHA0";
 		width = 17;
 		height = 34;
-		flags8text = "[8] Double size";
-		angletext = "Tag";
 	}
 	1108
 	{
@@ -1906,7 +1754,6 @@ castleeggman
 		sprite = "internal:chain3";
 		width = 17;
 		height = 34;
-		flags8text = "[8] Double size";
 	}
 	1109
 	{
@@ -1914,9 +1761,6 @@ castleeggman
 		sprite = "BFBRA0";
 		width = 17;
 		height = 34;
-		flags4text = "[4] No sounds";
-		flags8text = "[8] Double size";
-		angletext = "Tag";
 	}
 	1110
 	{
@@ -1924,8 +1768,6 @@ castleeggman
 		sprite = "SMCEA0";
 		width = 17;
 		height = 34;
-		flags4text = "[4] No sounds";
-		angletext = "Tag";
 	}
 	1111
 	{
@@ -1935,8 +1777,6 @@ castleeggman
 		sprite = "CSTAA1";
 		width = 16;
 		height = 40;
-		flags4text = "[4] Slides when pushed";
-		flags8text = "[8] Not pushable";
 	}
 	1112
 	{
@@ -1946,8 +1786,6 @@ castleeggman
 		sprite = "CBBSA1";
 		width = 32;
 		height = 72;
-		flags4text = "[4] Slides when pushed";
-		flags8text = "[8] Not pushable";
 	}
 	1114
 	{
@@ -1992,7 +1830,6 @@ castleeggman
 		sprite = "CNDLA0";
 		width = 8;
 		height = 48;
-		flags1text = "[1] Add corona";
 	}
 	1120
 	{
@@ -2000,7 +1837,6 @@ castleeggman
 		sprite = "CNDLB0";
 		width = 8;
 		height = 176;
-		flags1text = "[1] Add corona";
 	}
 	1121
 	{
@@ -2008,8 +1844,6 @@ castleeggman
 		sprite = "FLMHA0";
 		width = 24;
 		height = 80;
-		flags1text = "[1] Add corona";
-		flags4text = "[4] No flame";
 	}
 	1122
 	{
@@ -2032,8 +1866,6 @@ castleeggman
 		sprite = "CBLLA0";
 		width = 20;
 		height = 40;
-		flags4text = "[4] Slides when pushed";
-		flags8text = "[8] Not pushable";
 	}
 	1125
 	{
@@ -2085,7 +1917,6 @@ aridcanyon
 		sprite = "BTBLA0";
 		width = 24;
 		height = 48;
-		flags8text = "[8] Moves perpetually";
 	}
 	1201
 	{
@@ -2093,7 +1924,6 @@ aridcanyon
 		sprite = "STBLA0";
 		width = 12;
 		height = 24;
-		flags8text = "[8] Moves perpetually";
 	}
 	1202
 	{
@@ -2102,7 +1932,6 @@ aridcanyon
 		sprite = "ROIAA0";
 		width = 8;
 		height = 16;
-		angletext = "Tag";
 	}
 	1203
 	{
@@ -2237,7 +2066,6 @@ aridcanyon
 		sprite = "SALDARAL";
 		width = 96;
 		height = 160;
-		flags8text = "[8] Allow non-minecart players";
 	}
 	1222
 	{
@@ -2266,7 +2094,6 @@ aridcanyon
 		sprite = "internal:zoom";
 		width = 8;
 		height = 16;
-		flags8text = "[8] Enable switching";
 	}
 	1230
 	{
@@ -2296,9 +2123,6 @@ redvolcano
 		sprite = "internal:flameh";
 		width = 16;
 		height = 40;
-		flags8text = "[8] Waves vertically";
-		angletext = "On/Off time";
-		parametertext = "Strength";
 	}
 	1301
 	{
@@ -2306,9 +2130,6 @@ redvolcano
 		sprite = "internal:flamev";
 		width = 16;
 		height = 40;
-		flags8text = "[8] Shoot downwards";
-		angletext = "On/Off time";
-		parametertext = "Strength";
 	}
 	1302
 	{
@@ -2330,8 +2151,6 @@ redvolcano
 		sprite = "LFALF0";
 		width = 30;
 		height = 32;
-		angletext = "Initial delay";
-		flags8text = "[8] Double size";
 	}
 	1305
 	{
@@ -2339,7 +2158,6 @@ redvolcano
 		sprite = "PUMIA1A5";
 		width = 30;
 		height = 60;
-		flags8text = "[8] Non-buoyant";
 	}
 	1306
 	{
@@ -2634,8 +2452,6 @@ azuretemple
 		sprite = "BGARA1";
 		width = 16;
 		height = 40;
-		flags4text = "[4] Slides when pushed";
-		flags8text = "[8] Not pushable";
 	}
 	1501
 	{
@@ -2645,8 +2461,6 @@ azuretemple
 		sprite = "BGARA1";
 		width = 16;
 		height = 40;
-		flags4text = "[4] Slides when pushed";
-		flags8text = "[8] Not pushable";
 	}
 	1502
 	{
@@ -2656,8 +2470,6 @@ azuretemple
 		sprite = "BGARA1";
 		width = 16;
 		height = 40;
-		flags4text = "[4] Slides when pushed";
-		flags8text = "[8] Not pushable";
 	}
 	1503
 	{
@@ -2667,8 +2479,6 @@ azuretemple
 		sprite = "BGARA1";
 		width = 16;
 		height = 40;
-		flags4text = "[4] Slides when pushed";
-		flags8text = "[8] Not pushable";
 	}
 	1504
 	{
@@ -2692,8 +2502,6 @@ azuretemple
 		sprite = "BGARD1";
 		width = 16;
 		height = 40;
-		flags4text = "[4] Slides when pushed";
-		flags8text = "[8] Not pushable";
 	}
 }
 
@@ -2738,29 +2546,16 @@ nightstrk
 		title = "Axis";
 		sprite = "internal:axis1";
 		circle = 1;
-		unflippable = true;
-		ignoreZ = true;
-		flagsvaluetext = "Order";
-		angletext = "Radius/Direction";
-		parametertext = "Mare";
 	}
 	1701
 	{
 		title = "Axis Transfer";
 		sprite = "internal:axis2";
-		unflippable = true;
-		ignoreZ = true;
-		flagsvaluetext = "Order";
-		parametertext = "Mare";
 	}
 	1702
 	{
 		title = "Axis Transfer Line";
 		sprite = "internal:axis3";
-		unflippable = true;
-		ignoreZ = true;
-		flagsvaluetext = "Order";
-		parametertext = "Mare";
 	}
 	1710
 	{
@@ -2768,8 +2563,6 @@ nightstrk
 		sprite = "CAPSA0";
 		width = 72;
 		height = 144;
-		angletext = "Rings";
-		parametertext = "Mare";
 	}
 }
 
@@ -2786,11 +2579,6 @@ nights
 		sprite = "NDRNA1";
 		width = 16;
 		height = 56;
-		flags1text = "[1] Align player to middle";
-		flags4text = "[4] Align player to top";
-		flags8text = "[8] Die upon time up";
-		angletext = "Time limit";
-		parametertext = "Height";
 	}
 	1704
 	{
@@ -2799,9 +2587,6 @@ nights
 		sprite = "NBMPG3G7";
 		width = 32;
 		height = 64;
-		unflippable = true;
-		flagsvaluetext = "Pitch";
-		angletext = "Yaw";
 	}
 	1705
 	{
@@ -2810,10 +2595,6 @@ nights
 		sprite = "HOOPA0";
 		width = 80;
 		height = 160;
-		unflippable = true;
-		centerHitbox = true;
-		flagsvaluetext = "Height";
-		angletext = "Pitch/Yaw";
 	}
 	1706
 	{
@@ -2821,58 +2602,39 @@ nights
 		sprite = "SPHRA0";
 		width = 16;
 		height = 24;
-		flags8height = 24;
-		flags8text = "[8] Float";
-		unflippable = true;
 	}
 	1707
 	{
 		title = "Super Paraloop";
 		sprite = "NPRUA0";
-		flags4text = "[4] Bonus time only";
-		flags8text = "[8] Spawn immediately";
 	}
 	1708
 	{
 		title = "Drill Refill";
 		sprite = "NPRUB0";
-		flags4text = "[4] Bonus time only";
-		flags8text = "[8] Spawn immediately";
 	}
 	1709
 	{
 		title = "Nightopian Helper";
 		sprite = "NPRUC0";
-		flags4text = "[4] Bonus time only";
-		flags8text = "[8] Spawn immediately";
 	}
 	1711
 	{
 		title = "Extra Time";
 		sprite = "NPRUD0";
-		flags4text = "[4] Bonus time only";
-		flags8text = "[8] Spawn immediately";
 	}
 	1712
 	{
 		title = "Link Freeze";
 		sprite = "NPRUE0";
-		flags4text = "[4] Bonus time only";
-		flags8text = "[8] Spawn immediately";
 	}
 	1713
 	{
 		arrow = 1;
 		title = "Hoop (Customizable)";
-		flags1text = "[1] Radius +16";
-		flags2text = "[2] Radius +32";
-		flags4text = "[4] Radius +64";
-		flags8text = "[8] Radius +128";
 		sprite = "HOOPA0";
 		width = 80;
 		height = 160;
-		unflippable = true;
-		centerHitbox = true;
 	}
 	1714
 	{
@@ -2880,7 +2642,6 @@ nights
 		sprite = "internal:axis1";
 		width = 8;
 		height = 16;
-		parametertext = "Ideya";
 	}
 }
 
@@ -2895,8 +2656,6 @@ mario
 		sprite = "COINA0";
 		width = 16;
 		height = 24;
-		flags8height = 24;
-		flags8text = "[8] Float";
 	}
 	1801
 	{
@@ -2934,7 +2693,6 @@ mario
 		sprite = "PUMAA0";
 		width = 8;
 		height = 16;
-		angletext = "Jump strength";
 	}
 	1806
 	{
@@ -2999,8 +2757,6 @@ christmasdisco
 		sprite = "XMS3A0";
 		width = 16;
 		height = 64;
-		flags4text = "[4] Slides when pushed";
-		flags8text = "[8] Not pushable";
 	}
 	1853
 	{
@@ -3009,8 +2765,6 @@ christmasdisco
 		sprite = "XMS3B0";
 		width = 16;
 		height = 80;
-		flags4text = "[4] Slides when pushed";
-		flags8text = "[8] Not pushable";
 	}
 	1854
 	{
@@ -3071,8 +2825,6 @@ christmasdisco
 		sprite = "ESTAB1";
 		width = 20;
 		height = 96;
-		flags4text = "[4] Slides when pushed";
-		flags8text = "[8] Not pushable";
 	}
 }
 
@@ -3166,7 +2918,6 @@ hauntedheights
 		sprite = "FMCEA0";
 		width = 18;
 		height = 28;
-		angletext = "Initial delay";
 	}
 	2001
 	{
@@ -3209,7 +2960,6 @@ hauntedheights
 		sprite = "PUMKA0";
 		width = 16;
 		height = 40;
-		flags1text = "Don't flicker";
 	}
 	2007
 	{
@@ -3217,7 +2967,6 @@ hauntedheights
 		sprite = "PUMKB0";
 		width = 16;
 		height = 40;
-		flags1text = "Don't flicker";
 	}
 	2008
 	{
@@ -3225,7 +2974,6 @@ hauntedheights
 		sprite = "PUMKC0";
 		width = 16;
 		height = 40;
-		flags1text = "Don't flicker";
 	}
 	2009
 	{
@@ -3282,7 +3030,6 @@ frozenhillside
 		sprite = "ROSYA1";
 		width = 16;
 		height = 48;
-		flags1text = "[1] Grayscale mode";
 	}
 	2105
 	{
@@ -3299,10 +3046,6 @@ flickies
 	title = "Flickies";
 	width = 8;
 	height = 20;
-	flags1text = "[1] Move aimlessly";
-	flags4text = "[4] No movement";
-	flags8text = "[8] Hop";
-	angletext = "Radius";
 
 	2200
 	{
@@ -3343,7 +3086,6 @@ flickies
 	{
 		title = "Fish";
 		sprite = "FL08A1";
-		parametertext = "Color";
 	}
 	2208
 	{
diff --git a/extras/conf/SRB2-22.cfg b/extras/conf/SRB2-22.cfg
index ec318321d75fcb1b100f67c80d93c8750cb06282..12287ec80a82eb36b4bcc9d60974147258b9e034 100644
--- a/extras/conf/SRB2-22.cfg
+++ b/extras/conf/SRB2-22.cfg
@@ -435,7 +435,7 @@ sectortypes
 	112 = "Trigger Line Ex. (NiGHTS Mare)";
 	128 = "Check for Linedef Executor on FOFs";
 	144 = "Egg Capsule";
-	160 = "Special Stage Time/Rings Parameters";
+	160 = "Special Stage Time/Spheres Parameters";
 	176 = "Custom Global Gravity";
 	512 = "Wind/Current";
 	1024 = "Conveyor Belt";
@@ -490,7 +490,7 @@ gen_sectortypes
 		112 = "Trigger Line Ex. (NiGHTS Mare)";
 		128 = "Check for Linedef Executor on FOFs";
 		144 = "Egg Capsule";
-		160 = "Special Stage Time/Rings Parameters";
+		160 = "Special Stage Time/Spheres Parameters";
 		176 = "Custom Global Gravity";
 	}
 
@@ -766,6 +766,7 @@ linedeftypes
 		{
 			title = "Parameters";
 			prefix = "(22)";
+			flags32text = "[5] Render outer sides only";
 			flags64text = "[6] Trigger linedef executor";
 			flags128text = "[7] Intangible";
 			flags256text = "[8] Stopped by pushables";
@@ -788,7 +789,6 @@ linedeftypes
 		{
 			title = "Angular Displacement by Front Sector";
 			prefix = "(32)";
-			flags8text = "[3] Set delay by backside sector";
 			flags64text = "[6] Don't turn players";
 			flags512text = "[9] Turn all objects";
 		}
@@ -1136,7 +1136,6 @@ linedeftypes
 		{
 			title = "Goo Water, Translucent, No Sides";
 			prefix = "(125)";
-			flags8text = "[3] Slope skew sides";
 			flags64text = "[6] Use two light levels";
 			flags512text = "[9] Use target light level";
 			flags1024text = "[10] Ripple effect";
@@ -1227,6 +1226,18 @@ linedeftypes
 			3dfloorflags = "19F";
 		}
 
+		153
+		{
+			title = "Dynamically Sinking Platform";
+			prefix = "(153)";
+			flags8text = "[3] Slope skew sides";
+			flags32text = "[5] Only block player";
+			flags64text = "[6] Spindash to move";
+			flags128text = "[7] Only block non-players";
+			3dfloor = true;
+			3dfloorflags = "19F";
+		}
+
 		160
 		{
 			title = "Floating, Bobbing";
@@ -1282,7 +1293,6 @@ linedeftypes
 			title = "Rising Platform, Solid, Invisible";
 			prefix = "(193)";
 			flags2text = "[1] Sink when stepped on";
-			flags8text = "[3] Slope skew sides";
 			flags32text = "[5] Only block player";
 			flags64text = "[6] Spindash to move";
 			flags128text = "[7] Only block non-players";
@@ -1488,16 +1498,22 @@ linedeftypes
 		{
 			title = "Mario Block";
 			prefix = "(250)";
+			flags8text = "[3] Slope skew sides";
 			flags32text = "[5] Invisible block";
 			flags64text = "[6] Brick block";
 			3dfloor = true;
 			3dfloorflags = "40019F";
+			flags323dfloorflagsremove = "19E";
+			flags643dfloorflagsadd = "200000";
 		}
 
 		251
 		{
 			title = "Thwomp Block";
 			prefix = "(251)";
+			flags8text = "[3] Slope skew sides";
+			flags32text = "[5] Only block player";
+			flags128text = "[7] Only block non-players";
 			flags512text = "[9] Custom crushing sound";
 			flags1024text = "[10] Custom speed";
 			3dfloor = true;
@@ -1513,8 +1529,8 @@ linedeftypes
 			flags512text = "[9] Shattered by pushables";
 			flags1024text = "[10] Trigger linedef executor";
 			3dfloor = true;
-			3dfloorflags = "8800019";
-			flags643dfloorflagsadd = "200006";
+			3dfloorflags = "880001D";
+			flags643dfloorflagsadd = "200002";
 		}
 
 		253
@@ -1525,7 +1541,7 @@ linedeftypes
 			flags512text = "[9] Shattered by pushables";
 			flags1024text = "[10] Trigger linedef executor";
 			3dfloor = true;
-			3dfloorflags = "8801019";
+			3dfloorflags = "880101D";
 		}
 
 		254
@@ -1533,6 +1549,7 @@ linedeftypes
 			title = "Bustable Block";
 			prefix = "(254)";
 			flags8text = "[3] Slope skew sides";
+			flags32text = "[5] Only block player";
 			flags64text = "[6] Strong characters only";
 			flags128text = "[7] Only block non-players";
 			flags512text = "[9] Shattered by pushables";
@@ -1593,6 +1610,7 @@ linedeftypes
 		{
 			title = "Custom FOF";
 			prefix = "(259)";
+			flags8text = "[3] Slope skew sides";
 			flags32text = "[5] Only block player";
 			flags128text = "[7] Only block non-players";
 			flags512text = "[9] Shattered by pushables";
@@ -2161,6 +2179,14 @@ linedeftypes
 			flags8text = "[3] Set delay by backside sector";
 		}
 
+		449
+		{
+			title = "Enable Bosses with Parameter";
+			prefix = "(449)";
+			flags8text = "[3] Set delay by backside sector";
+			flags64text = "[6] Disable bosses";
+		}
+
 		457
 		{
 			title = "Track Object's Angle";
@@ -2180,12 +2206,14 @@ linedeftypes
 		{
 			title = "Award Rings";
 			prefix = "(460)";
+			flags8text = "[3] Set delay by backside sector";
 		}
 
 		461
 		{
 			title = "Spawn Object";
 			prefix = "(461)";
+			flags8text = "[3] Set delay by backside sector";
 			flags64text = "[6] Spawn inside a range";
 		}
 
@@ -2193,6 +2221,7 @@ linedeftypes
 		{
 			title = "Stop Timer/Exit Stage in Record Attack";
 			prefix = "(462)";
+			flags8text = "[3] Set delay by backside sector";
 		}
 	}
 
@@ -2206,7 +2235,7 @@ linedeftypes
 			prefix = "(413)";
 			flags2text = "[1] Keep after death";
 			flags8text = "[3] Set delay by backside sector";
-			flags32text = "[5] Seek to current song position";
+			flags32text = "[5] Seek from current position";
 			flags64text = "[6] For everyone";
 			flags128text = "[7] Fade to custom volume";
 			flags512text = "[9] Don't loop";
@@ -2220,7 +2249,7 @@ linedeftypes
 			flags2text = "[1] From calling sector";
 			flags8text = "[3] Set delay by backside sector";
 			flags64text = "[6] From nowhere for triggerer";
-			flags512text = "[9] For everyone";
+			flags512text = "[9] From nowhere for everyone";
 			flags1024text = "[10] From tagged sectors";
 		}
 
@@ -2298,7 +2327,6 @@ linedeftypes
 			flags8text = "[3] Set delay by backside sector";
 		}
 
-
 		445
 		{
 			title = "Make FOF Disappear/Reappear";
@@ -2325,8 +2353,8 @@ linedeftypes
 			flags32text = "[5] Subtract Red value";
 			flags64text = "[6] Subtract Green value";
 			flags128text = "[7] Subtract Blue value";
-			flags256text = "[8] Calc relative values";
-			flags32768text = "[15] Use back side colormap";
+			flags256text = "[8] Set relative to current";
+			flags32768text = "[15] Use backside colormap";
 		}
 
 		448
@@ -2359,7 +2387,7 @@ linedeftypes
 			prefix = "(452)";
 			flags8text = "[3] Set delay by backside sector";
 			flags64text = "[6] Do not handle FF_TRANS";
-			flags256text = "[8] Set relative to current val";
+			flags256text = "[8] Set relative to current";
 		}
 
 		453
@@ -2371,7 +2399,7 @@ linedeftypes
 			flags32text = "[5] No collision during fade";
 			flags64text = "[6] Do not handle FF_TRANS";
 			flags128text = "[7] Do not handle lighting";
-			flags256text = "[8] Set relative to current val";
+			flags256text = "[8] Set relative to current";
 			flags512text = "[9] Speed = Tic Duration";
 			flags1024text = "[10] Override existing fade";
 			flags16384text = "[14] Do not handle collision";
@@ -2395,11 +2423,11 @@ linedeftypes
 			flags32text = "[5] Subtract Red value";
 			flags64text = "[6] Subtract Green value";
 			flags128text = "[7] Subtract Blue value";
-			flags256text = "[8] Calc relative values";
+			flags256text = "[8] Set relative to current";
 			flags512text = "[9] Speed = Tic Duration";
 			flags1024text = "[10] Override existing fade";
 			flags16384text = "[14] Fade from invisible black";
-			flags32768text = "[15] Use back side colormap";
+			flags32768text = "[15] Use backside colormap";
 		}
 
 		456
@@ -2416,9 +2444,7 @@ linedeftypes
 			flags2text = "[1] Close text prompt";
 			flags8text = "[3] Set delay by backside sector";
 			flags32text = "[5] Run executor tag on close";
-			flags64text = "[6] For everyone";
-			flags128text = "[7] Do not block controls";
-			flags256text = "[8] Do not freeze time";
+			flags128text = "[7] Don't disable controls";
 			flags32768text = "[15] Find prompt by name";
 		}
 	}
@@ -2524,7 +2550,7 @@ linedeftypes
 			prefix = "(491)";
 			flags8text = "[3] Set delay by backside sector";
 			flags16text = "[4] Set raw alpha by Front X";
-			flags256text = "[8] Calc relative values";
+			flags256text = "[8] Set relative to current";
 		}
 
 		492
@@ -2534,7 +2560,7 @@ linedeftypes
 			flags8text = "[3] Set delay by backside sector";
 			flags16text = "[4] Set raw alpha by Front X";
 			flags32text = "[5] No collision during fade";
-			flags256text = "[8] Calc relative values";
+			flags256text = "[8] Set relative to current";
 			flags512text = "[9] Speed = Tic Duration";
 			flags1024text = "[10] Override existing fade";
 			flags16384text = "[14] Do not handle collision";
@@ -2632,76 +2658,84 @@ linedeftypes
 		{
 			title = "Carry Objects on Floor";
 			prefix = "(520)";
+			flags64text = "[6] Exclusive";
 		}
 
 		521
 		{
 			title = "Carry Objects on Floor (Accelerative)";
 			prefix = "(521)";
-			flags64text = "[6] Even across edges";
+			flags64text = "[6] Exclusive";
 		}
 
 		522
 		{
 			title = "Carry Objects on Floor (Displacement)";
 			prefix = "(522)";
+			flags64text = "[6] Exclusive";
 		}
 
 		523
 		{
 			title = "Carry Objects on Ceiling";
 			prefix = "(523)";
-			flags64text = "[6] Even across edges";
+			flags64text = "[6] Exclusive";
 		}
 
 		524
 		{
 			title = "Carry Objects on Ceiling (Accelerative)";
 			prefix = "(524)";
+			flags64text = "[6] Exclusive";
 		}
 
 		525
 		{
 			title = "Carry Objects on Ceiling (Displacement)";
 			prefix = "(525)";
+			flags64text = "[6] Exclusive";
 		}
 
 		530
 		{
 			title = "Scroll Floor Texture and Carry Objects";
 			prefix = "(530)";
-			flags64text = "[6] Even across edges";
+			flags64text = "[6] Exclusive";
 		}
 
 		531
 		{
 			title = "Scroll Floor Texture and Carry Objects (Accelerative)";
 			prefix = "(531)";
+			flags64text = "[6] Exclusive";
 		}
 
 		532
 		{
 			title = "Scroll Floor Texture and Carry Objects (Displacement)";
 			prefix = "(532)";
+			flags64text = "[6] Exclusive";
 		}
 
 		533
 		{
 			title = "Scroll Ceiling Texture and Carry Objects";
 			prefix = "(533)";
-			flags64text = "[6] Even across edges";
+			flags64text = "[6] Exclusive";
 		}
 
 		534
 		{
 			title = "Scroll Ceiling Texture and Carry Objects (Accelerative)";
 			prefix = "(534)";
+			flags64text = "[6] Exclusive";
 		}
 
 		535
 		{
 			title = "Scroll Ceiling Texture and Carry Objects (Displacement)";
 			prefix = "(535)";
+			flags64text = "[6] Exclusive";
 		}
 	}
 
@@ -2714,7 +2748,7 @@ linedeftypes
 			title = "Wind";
 			prefix = "(541)";
 			flags512text = "[9] Player slides";
-			flags64text = "[6] Even across edges";
+			flags64text = "[6] Exclusive";
 		}
 
 		542
@@ -2722,7 +2756,7 @@ linedeftypes
 			title = "Upwards Wind";
 			prefix = "(542)";
 			flags512text = "[9] Player slides";
-			flags64text = "[6] Even across edges";
+			flags64text = "[6] Exclusive";
 		}
 
 		543
@@ -2730,7 +2764,7 @@ linedeftypes
 			title = "Downwards Wind";
 			prefix = "(543)";
 			flags512text = "[9] Player slides";
-			flags64text = "[6] Even across edges";
+			flags64text = "[6] Exclusive";
 		}
 
 		544
@@ -2738,7 +2772,7 @@ linedeftypes
 			title = "Current";
 			prefix = "(544)";
 			flags512text = "[9] Player slides";
-			flags64text = "[6] Even across edges";
+			flags64text = "[6] Exclusive";
 		}
 
 		545
@@ -2746,7 +2780,7 @@ linedeftypes
 			title = "Upwards Current";
 			prefix = "(545)";
 			flags512text = "[9] Player slides";
-			flags64text = "[6] Even across edges";
+			flags64text = "[6] Exclusive";
 		}
 
 		546
@@ -2754,13 +2788,14 @@ linedeftypes
 			title = "Downwards Current";
 			prefix = "(546)";
 			flags512text = "[9] Player slides";
-			flags64text = "[6] Even across edges";
+			flags64text = "[6] Exclusive";
 		}
 
 		547
 		{
 			title = "Push/Pull";
 			prefix = "(547)";
+			flags64text = "[6] Exclusive";
 		}
 	}
 
@@ -3407,8 +3442,8 @@ thingtypes
 			sprite = "ESHIA1";
 			width = 16;
 			height = 48;
-			flags1text = "[1] 90 degrees counter-clockwise";
-			flags4text = "[4] 90 degrees clockwise";
+			flags1text = "[1] 90 degrees clockwise";
+			flags4text = "[4] 90 degrees counter-clockwise";
 			flags8text = "[8] Double speed";
 		}
 		115
@@ -3897,9 +3932,10 @@ thingtypes
 		title = "Monitors";
 		width = 18;
 		height = 40;
-		flags1text = "[1] Run Linedef Executor on pop";
+		flags1text = "[1] Run linedef executor on pop";
 		flags4text = "[4] Random (Strong)";
 		flags8text = "[8] Random (Weak)";
+		angletext = "Tag";
 
 		400
 		{
@@ -4029,7 +4065,8 @@ thingtypes
 		title = "Monitors (Respawning)";
 		width = 20;
 		height = 44;
-		flags1text = "[1] Run Linedef Executor on pop";
+		flags1text = "[1] Run linedef executor on pop";
+		angletext = "Tag";
 
 		431
 		{
@@ -4125,7 +4162,9 @@ thingtypes
 			sprite = "STPTA0M0";
 			width = 64;
 			height = 128;
+			flags4text = "[4] Respawn at center";
 			angletext = "Angle/Order";
+			parametertext = "Order";
 		}
 		520
 		{
@@ -4558,6 +4597,7 @@ thingtypes
 			sprite = "TOADA0";
 			width = 32;
 			height = 16;
+			angletext = "Tag";
 		}
 		757
 		{
@@ -5832,7 +5872,7 @@ thingtypes
 			sprite = "CAPSA0";
 			width = 72;
 			height = 144;
-			angletext = "Rings";
+			angletext = "Spheres";
 			parametertext = "Mare";
 		}
 	}
@@ -6273,7 +6313,7 @@ thingtypes
 			sprite = "PUMKA0";
 			width = 16;
 			height = 40;
-			flags1text = "Don't flicker";
+			flags1text = "[1] Don't flicker";
 		}
 		2007
 		{
@@ -6281,7 +6321,7 @@ thingtypes
 			sprite = "PUMKB0";
 			width = 16;
 			height = 40;
-			flags1text = "Don't flicker";
+			flags1text = "[1] Don't flicker";
 		}
 		2008
 		{
@@ -6289,7 +6329,7 @@ thingtypes
 			sprite = "PUMKC0";
 			width = 16;
 			height = 40;
-			flags1text = "Don't flicker";
+			flags1text = "[1] Don't flicker";
 		}
 		2009
 		{
diff --git a/extras/conf/SRB2_22Doom.cfg b/extras/conf/SRB2_22Doom.cfg
index 65e49d3871be87df0c3eb20831543a3304191d1d..891b9d507fefd1ba1eb5c7334cdafc91f3be10ec 100644
--- a/extras/conf/SRB2_22Doom.cfg
+++ b/extras/conf/SRB2_22Doom.cfg
@@ -1,5 +1,5 @@
-/************************************************************************\
-	Zone Builder Game Configuration for Sonic Robo Blast 2 Version 2.2
+/************************************************************************\
+	Ultimate Doom Builder Game Configuration for Sonic Robo Blast 2 Version 2.2
 \************************************************************************/
 
 // This is required to prevent accidental use of a different configuration
diff --git a/extras/conf/SRB2_22UDMF.cfg b/extras/conf/SRB2_22UDMF.cfg
index 52104ed090b766914ee69d350c16799b1272d0d2..749cf499abd98560e0be78aa40b1b75b1bd7935a 100644
--- a/extras/conf/SRB2_22UDMF.cfg
+++ b/extras/conf/SRB2_22UDMF.cfg
@@ -1,5 +1,5 @@
-/************************************************************************\
-	Zone Builder Game Configuration for Sonic Robo Blast 2 Version 2.2
+/************************************************************************\
+	Ultimate Doom Builder Game Configuration for Sonic Robo Blast 2 Version 2.2
 \************************************************************************/
 
 // This is required to prevent accidental use of a different configuration
@@ -14,7 +14,7 @@ engine = "zdoom";
 // Settings common to all games and all map formats
 include("Includes\\SRB222_common.cfg", "common");
 
-// Settings common to Doom map format
+// Settings common to text map format
 include("Includes\\SRB222_common.cfg", "mapformat_udmf");
 
 include("Includes\\Game_SRB222.cfg");
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 4971736caf807faf927eb088593fdcc44ef753bc..372341291bc0fe6118ab20a81350ad658bd5a102 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -120,6 +120,7 @@ set(SRB2_CORE_RENDER_SOURCES
 	r_main.c
 	r_plane.c
 	r_segs.c
+	r_skins.c
 	r_sky.c
 	r_splats.c
 	r_things.c
@@ -134,6 +135,7 @@ set(SRB2_CORE_RENDER_SOURCES
 	r_main.h
 	r_plane.h
 	r_segs.h
+	r_skins.h
 	r_sky.h
 	r_splats.h
 	r_state.h
@@ -214,8 +216,6 @@ source_group("Assembly" FILES ${SRB2_ASM_SOURCES} ${SRB2_NASM_SOURCES})
 
 
 ### Configuration
-set(SRB2_CONFIG_HAVE_BLUA ON CACHE BOOL
-	"Enable Lua interpreter support")
 set(SRB2_CONFIG_HAVE_PNG ON CACHE BOOL
 	"Enable PNG support. Depends on zlib, so will be disabled if you don't enable that too.")
 set(SRB2_CONFIG_HAVE_ZLIB ON CACHE BOOL
@@ -239,93 +239,90 @@ if(${CMAKE_SYSTEM} MATCHES "Windows") ###set on Windows only
 	"Use SRB2's internal copies of required dependencies (SDL2, PNG, zlib, GME, OpenMPT).")
 endif()
 
-if(${SRB2_CONFIG_HAVE_BLUA})
-	add_definitions(-DHAVE_BLUA)
-	set(SRB2_LUA_SOURCES
-		lua_baselib.c
-		lua_blockmaplib.c
-		lua_consolelib.c
-		lua_hooklib.c
-		lua_hudlib.c
-		lua_infolib.c
-		lua_maplib.c
-		lua_mathlib.c
-		lua_mobjlib.c
-		lua_playerlib.c
-		lua_script.c
-		lua_skinlib.c
-		lua_thinkerlib.c
-	)
-	set(SRB2_LUA_HEADERS
-		lua_hook.h
-		lua_hud.h
-		lua_libs.h
-		lua_script.h
-	)
+set(SRB2_LUA_SOURCES
+	lua_baselib.c
+	lua_blockmaplib.c
+	lua_consolelib.c
+	lua_hooklib.c
+	lua_hudlib.c
+	lua_infolib.c
+	lua_maplib.c
+	lua_mathlib.c
+	lua_mobjlib.c
+	lua_playerlib.c
+	lua_script.c
+	lua_skinlib.c
+	lua_thinkerlib.c
+)
+set(SRB2_LUA_HEADERS
+	lua_hook.h
+	lua_hud.h
+	lua_libs.h
+	lua_script.h
+)
 
-	prepend_sources(SRB2_LUA_SOURCES)
-	prepend_sources(SRB2_LUA_HEADERS)
-
-	source_group("LUA" FILES ${SRB2_LUA_SOURCES} ${SRB2_LUA_HEADERS})
-
-	set(SRB2_BLUA_SOURCES
-		blua/lapi.c
-		blua/lauxlib.c
-		blua/lbaselib.c
-		blua/lcode.c
-		blua/ldebug.c
-		blua/ldo.c
-		blua/ldump.c
-		blua/lfunc.c
-		blua/lgc.c
-		blua/linit.c
-		blua/liolib.c
-		blua/llex.c
-		blua/lmem.c
-		blua/lobject.c
-		blua/lopcodes.c
-		blua/lparser.c
-		blua/lstate.c
-		blua/lstring.c
-		blua/lstrlib.c
-		blua/ltable.c
-		blua/ltablib.c
-		blua/ltm.c
-		blua/lundump.c
-		blua/lvm.c
-		blua/lzio.c
-	)
-	set(SRB2_BLUA_HEADERS
-		blua/lapi.h
-		blua/lauxlib.h
-		blua/lcode.h
-		blua/ldebug.h
-		blua/ldo.h
-		blua/lfunc.h
-		blua/lgc.h
-		blua/llex.h
-		blua/llimits.h
-		blua/lmem.h
-		blua/lobject.h
-		blua/lopcodes.h
-		blua/lparser.h
-		blua/lstate.h
-		blua/lstring.h
-		blua/ltable.h
-		blua/ltm.h
-		blua/lua.h
-		blua/luaconf.h
-		blua/lualib.h
-		blua/lundump.h
-		blua/lvm.h
-		blua/lzio.h
-	)
+prepend_sources(SRB2_LUA_SOURCES)
+prepend_sources(SRB2_LUA_HEADERS)
+
+source_group("LUA" FILES ${SRB2_LUA_SOURCES} ${SRB2_LUA_HEADERS})
+
+set(SRB2_BLUA_SOURCES
+	blua/lapi.c
+	blua/lauxlib.c
+	blua/lbaselib.c
+	blua/lcode.c
+	blua/ldebug.c
+	blua/ldo.c
+	blua/ldump.c
+	blua/lfunc.c
+	blua/lgc.c
+	blua/linit.c
+	blua/liolib.c
+	blua/llex.c
+	blua/lmem.c
+	blua/lobject.c
+	blua/lopcodes.c
+	blua/lparser.c
+	blua/lstate.c
+	blua/lstring.c
+	blua/lstrlib.c
+	blua/ltable.c
+	blua/ltablib.c
+	blua/ltm.c
+	blua/lundump.c
+	blua/lvm.c
+	blua/lzio.c
+)
+set(SRB2_BLUA_HEADERS
+	blua/lapi.h
+	blua/lauxlib.h
+	blua/lcode.h
+	blua/ldebug.h
+	blua/ldo.h
+	blua/lfunc.h
+	blua/lgc.h
+	blua/llex.h
+	blua/llimits.h
+	blua/lmem.h
+	blua/lobject.h
+	blua/lopcodes.h
+	blua/lparser.h
+	blua/lstate.h
+	blua/lstring.h
+	blua/ltable.h
+	blua/ltm.h
+	blua/lua.h
+	blua/luaconf.h
+	blua/lualib.h
+	blua/lundump.h
+	blua/lvm.h
+	blua/lzio.h
+)
 
-	prepend_sources(SRB2_BLUA_SOURCES)
-	prepend_sources(SRB2_BLUA_HEADERS)
+prepend_sources(SRB2_BLUA_SOURCES)
+prepend_sources(SRB2_BLUA_HEADERS)
 
-	source_group("LUA\\Interpreter" FILES ${SRB2_BLUA_SOURCES} ${SRB2_BLUA_HEADERS})
-endif()
+source_group("LUA\\Interpreter" FILES ${SRB2_BLUA_SOURCES} ${SRB2_BLUA_HEADERS})
 
 if(${SRB2_CONFIG_HAVE_GME})
 	if(${SRB2_CONFIG_USE_INTERNAL_LIBRARIES})
diff --git a/src/Makefile b/src/Makefile
index 9f368217cc14a453138af6ac1f354434c888f4ef..1ebd39ac40e4d417ec74c2cc6c6ff616463e7626 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -340,9 +340,7 @@ CFLAGS+=-DHAVE_MINIUPNPC
 endif
 endif
 
-ifndef NO_LUA
-	include blua/Makefile.cfg
-endif
+include blua/Makefile.cfg
 
 ifdef NOMD5
 	OPTS+=-DNOMD5
@@ -468,6 +466,7 @@ OBJS:=$(i_main_o) \
 		$(OBJDIR)/r_main.o   \
 		$(OBJDIR)/r_plane.o  \
 		$(OBJDIR)/r_segs.o   \
+		$(OBJDIR)/r_skins.o  \
 		$(OBJDIR)/r_sky.o    \
 		$(OBJDIR)/r_splats.o \
 		$(OBJDIR)/r_things.o \
@@ -682,9 +681,7 @@ $(OBJDIR)/depend.dep:
 ifndef NOHW
 	$(CC) $(CFLAGS) -MM hardware/*.c >> $(OBJDIR)/depend.ped
 endif
-ifndef NO_LUA
 	$(CC) $(CFLAGS) -MM blua/*.c >> $(OBJDIR)/depend.ped
-endif
 	@sed -e 's,\(.*\)\.o: ,$(subst /,\/,$(OBJDIR))\/&,g' < $(OBJDIR)/depend.ped > $(OBJDIR)/depend.dep
 	$(REMOVE) $(OBJDIR)/depend.ped
 	@echo "Created dependency file, depend.dep"
diff --git a/src/am_map.c b/src/am_map.c
index 234df1abd81cf5e619514c990de9c8c213a935ea..cdbaaf80aea702a02b77618ac4081c6cbb7abfa6 100644
--- a/src/am_map.c
+++ b/src/am_map.c
@@ -920,10 +920,8 @@ static inline void AM_drawWalls(void)
 {
 	size_t i;
 	static mline_t l;
-#ifdef ESLOPE
 	fixed_t frontf1,frontf2, frontc1, frontc2; // front floor/ceiling ends
 	fixed_t backf1 = 0, backf2 = 0, backc1 = 0, backc2 = 0; // back floor ceiling ends
-#endif
 
 	for (i = 0; i < numlines; i++)
 	{
@@ -931,7 +929,7 @@ static inline void AM_drawWalls(void)
 		l.a.y = lines[i].v1->y >> FRACTOMAPBITS;
 		l.b.x = lines[i].v2->x >> FRACTOMAPBITS;
 		l.b.y = lines[i].v2->y >> FRACTOMAPBITS;
-#ifdef ESLOPE
+
 #define SLOPEPARAMS(slope, end1, end2, normalheight) \
 		if (slope) { \
 			end1 = P_GetZAt(slope, lines[i].v1->x, lines[i].v1->y); \
@@ -946,7 +944,6 @@ static inline void AM_drawWalls(void)
 			SLOPEPARAMS(lines[i].backsector->c_slope, backc1,  backc2,  lines[i].backsector->ceilingheight)
 		}
 #undef SLOPEPARAMS
-#endif
 
 		if (!lines[i].backsector) // 1-sided
 		{
@@ -955,19 +952,11 @@ static inline void AM_drawWalls(void)
 			else
 				AM_drawMline(&l, WALLCOLORS);
 		}
-#ifdef ESLOPE
 		else if ((backf1 == backc1 && backf2 == backc2) // Back is thok barrier
 				 || (frontf1 == frontc1 && frontf2 == frontc2)) // Front is thok barrier
 		{
 			if (backf1 == backc1 && backf2 == backc2
 				&& frontf1 == frontc1 && frontf2 == frontc2) // BOTH are thok barriers
-#else
-		else if (lines[i].backsector->floorheight == lines[i].backsector->ceilingheight // Back is thok barrier
-				 || lines[i].frontsector->floorheight == lines[i].frontsector->ceilingheight) // Front is thok barrier
-		{
-			if (lines[i].backsector->floorheight == lines[i].backsector->ceilingheight
-				&& lines[i].frontsector->floorheight == lines[i].frontsector->ceilingheight) // BOTH are thok barriers
-#endif
 			{
 				if (lines[i].flags & ML_NOCLIMB)
 					AM_drawMline(&l, NOCLIMBTSWALLCOLORS);
@@ -985,20 +974,10 @@ static inline void AM_drawWalls(void)
 		else
 		{
 			if (lines[i].flags & ML_NOCLIMB) {
-#ifdef ESLOPE
 				if (backf1 != frontf1 || backf2 != frontf2) {
-#else
-				if (lines[i].backsector->floorheight
-						!= lines[i].frontsector->floorheight) {
-#endif
 					AM_drawMline(&l, NOCLIMBFDWALLCOLORS); // floor level change
 				}
-#ifdef ESLOPE
 				else if (backc1 != frontc1 || backc2 != frontc2) {
-#else
-				else if (lines[i].backsector->ceilingheight
-						!= lines[i].frontsector->ceilingheight) {
-#endif
 					AM_drawMline(&l, NOCLIMBCDWALLCOLORS); // ceiling level change
 				}
 				else
@@ -1006,20 +985,10 @@ static inline void AM_drawWalls(void)
 			}
 			else
 			{
-#ifdef ESLOPE
 				if (backf1 != frontf1 || backf2 != frontf2) {
-#else
-				if (lines[i].backsector->floorheight
-						!= lines[i].frontsector->floorheight) {
-#endif
 					AM_drawMline(&l, FDWALLCOLORS); // floor level change
 				}
-#ifdef ESLOPE
 				else if (backc1 != frontc1 || backc2 != frontc2) {
-#else
-				else if (lines[i].backsector->ceilingheight
-						!= lines[i].frontsector->ceilingheight) {
-#endif
 					AM_drawMline(&l, CDWALLCOLORS); // ceiling level change
 				}
 				else
diff --git a/src/b_bot.c b/src/b_bot.c
index 4f904b6728892688a192b16f670d8dfb00342d34..4fefbdcb61b78a4972cf729d55a054cd2497f7da 100644
--- a/src/b_bot.c
+++ b/src/b_bot.c
@@ -74,11 +74,9 @@ static void B_BuildTailsTiccmd(mobj_t *sonic, mobj_t *tails, ticcmd_t *cmd)
 	if (!sonic || sonic->health <= 0)
 		return;
 
-#ifdef HAVE_BLUA
 	// Lua can handle it!
 	if (LUAh_BotAI(sonic, tails, cmd))
 		return;
-#endif
 
 	if (tails->player->powers[pw_carry] == CR_MACESPIN || tails->player->powers[pw_carry] == CR_GENERIC)
 	{
@@ -364,11 +362,9 @@ void B_BuildTiccmd(player_t *player, ticcmd_t *cmd)
 	// Bot AI isn't programmed in analog.
 	CV_SetValue(&cv_analog[1], false);
 
-#ifdef HAVE_BLUA
 	// Let Lua scripts build ticcmds
 	if (LUAh_BotTiccmd(player, cmd))
 		return;
-#endif
 
 	// We don't have any main character AI, sorry. D:
 	if (player-players == consoleplayer)
diff --git a/src/blua/Makefile.cfg b/src/blua/Makefile.cfg
index 659faf3c812948a407e33c5036a74652e18f5e86..12ea064b417fc60ad14fd1a3520d6b0280b6fce8 100644
--- a/src/blua/Makefile.cfg
+++ b/src/blua/Makefile.cfg
@@ -10,8 +10,6 @@ WFLAGS+=-Wno-logical-op
 endif
 endif
 
-OPTS+=-DHAVE_BLUA
-
 OBJS:=$(OBJS) \
 	$(OBJDIR)/lapi.o \
 	$(OBJDIR)/lbaselib.o \
diff --git a/src/command.c b/src/command.c
index d1eea6052d0844f98472b4ad53e700f82e72aef7..72dc9f769908cf2e0f096caf9cc5413b14ed2388 100644
--- a/src/command.c
+++ b/src/command.c
@@ -481,13 +481,11 @@ void COM_AddCommand(const char *name, com_func_t func)
 	{
 		if (!stricmp(name, cmd->name)) //case insensitive now that we have lower and uppercase!
 		{
-#ifdef HAVE_BLUA
 			// don't I_Error for Lua commands
 			// Lua commands can replace game commands, and they have priority.
 			// BUT, if for some reason we screwed up and made two console commands with the same name,
 			// it's good to have this here so we find out.
 			if (cmd->function != COM_Lua_f)
-#endif
 				I_Error("Command %s already exists\n", name);
 
 			return;
@@ -501,7 +499,6 @@ void COM_AddCommand(const char *name, com_func_t func)
 	com_commands = cmd;
 }
 
-#ifdef HAVE_BLUA
 /** Adds a console command for Lua.
   * No I_Errors allowed; return a negative code instead.
   *
@@ -534,7 +531,6 @@ int COM_AddLuaCommand(const char *name)
 	com_commands = cmd;
 	return 0;
 }
-#endif
 
 /** Tests if a command exists.
   *
@@ -1427,9 +1423,7 @@ finish:
 	}
 	var->flags |= CV_MODIFIED;
 	// raise 'on change' code
-#ifdef HAVE_BLUA
 	LUA_CVarChanged(var->name); // let consolelib know what cvar this is.
-#endif
 	if (var->flags & CV_CALL && !stealth)
 		var->func();
 
diff --git a/src/d_clisrv.c b/src/d_clisrv.c
index ae9b91ec52b75abe5c539420ba75c6200d70e282..aa5d4cb9a9e11a51e3eca4fad9a0638b3b33d0a5 100644
--- a/src/d_clisrv.c
+++ b/src/d_clisrv.c
@@ -1289,6 +1289,37 @@ static boolean CL_SendJoin(void)
 	return HSendPacket(servernode, true, 0, sizeof (clientconfig_pak));
 }
 
+static INT32 FindRejoinerNum(SINT8 node)
+{
+	char strippednodeaddress[64];
+	const char *nodeaddress;
+	char *port;
+	INT32 i;
+
+	// Make sure there is no dead dress before proceeding to the stripping
+	if (!I_GetNodeAddress)
+		return -1;
+	nodeaddress = I_GetNodeAddress(node);
+	if (!nodeaddress)
+		return -1;
+
+	// Strip the address of its port
+	strcpy(strippednodeaddress, nodeaddress);
+	port = strchr(strippednodeaddress, ':');
+	if (port)
+		*port = '\0';
+
+	// Check if any player matches the stripped address
+	for (i = 0; i < MAXPLAYERS; i++)
+	{
+		if (playeringame[i] && playeraddress[i][0] && playernode[i] == UINT8_MAX
+		&& !strcmp(playeraddress[i], strippednodeaddress))
+			return i;
+	}
+
+	return -1;
+}
+
 static void SV_SendServerInfo(INT32 node, tic_t servertime)
 {
 	UINT8 *p;
@@ -1306,6 +1337,16 @@ static void SV_SendServerInfo(INT32 node, tic_t servertime)
 
 	netbuffer->u.serverinfo.numberofplayer = (UINT8)D_NumPlayers();
 	netbuffer->u.serverinfo.maxplayer = (UINT8)cv_maxplayers.value;
+
+	if (FindRejoinerNum(node) != -1)
+		netbuffer->u.serverinfo.refusereason = 0;
+	else if (!cv_allownewplayer.value)
+		netbuffer->u.serverinfo.refusereason = 1;
+	else if (D_NumPlayers() >= cv_maxplayers.value)
+		netbuffer->u.serverinfo.refusereason = 2;
+	else
+		netbuffer->u.serverinfo.refusereason = 0;
+
 	strncpy(netbuffer->u.serverinfo.gametypename, Gametype_Names[gametype],
 			sizeof netbuffer->u.serverinfo.gametypename);
 	netbuffer->u.serverinfo.modifiedgame = (UINT8)modifiedgame;
@@ -1863,12 +1904,17 @@ static boolean CL_ServerConnectionSearchTicker(boolean viams, tic_t *asksent)
 		}
 
 		// Quit here rather than downloading files and being refused later.
-		if (serverlist[i].info.numberofplayer >= serverlist[i].info.maxplayer)
+		if (serverlist[i].info.refusereason)
 		{
 			D_QuitNetGame();
 			CL_Reset();
 			D_StartTitle();
-			M_StartMessage(va(M_GetText("Maximum players reached: %d\n\nPress ESC\n"), serverlist[i].info.maxplayer), NULL, MM_NOTHING);
+			if (serverlist[i].info.refusereason == 1)
+				M_StartMessage(M_GetText("The server is not accepting\njoins for the moment.\n\nPress ESC\n"), NULL, MM_NOTHING);
+			else if (serverlist[i].info.refusereason == 2)
+				M_StartMessage(va(M_GetText("Maximum players reached: %d\n\nPress ESC\n"), serverlist[i].info.maxplayer), NULL, MM_NOTHING);
+			else
+				M_StartMessage(M_GetText("You can't join.\nI don't know why,\nbut you can't join.\n\nPress ESC\n"), NULL, MM_NOTHING);
 			return false;
 		}
 
@@ -2439,14 +2485,14 @@ static void CL_RemovePlayer(INT32 playernum, kickreason_t reason)
 	if (!playeringame[playernum])
 		return;
 
-	if (server && !demoplayback)
+	if (server && !demoplayback && playernode[playernum] != UINT8_MAX)
 	{
 		INT32 node = playernode[playernum];
 		playerpernode[node]--;
 		if (playerpernode[node] <= 0)
 		{
-			nodeingame[playernode[playernum]] = false;
-			Net_CloseConnection(playernode[playernum]);
+			nodeingame[node] = false;
+			Net_CloseConnection(node);
 			ResetNode(node);
 		}
 	}
@@ -2501,20 +2547,14 @@ static void CL_RemovePlayer(INT32 playernum, kickreason_t reason)
 		}
 	}
 
-#ifdef HAVE_BLUA
 	LUAh_PlayerQuit(&players[playernum], reason); // Lua hook for player quitting
-#else
-	(void)reason;
-#endif
 
 	// don't look through someone's view who isn't there
 	if (playernum == displayplayer)
 	{
-#ifdef HAVE_BLUA
 		// Call ViewpointSwitch hooks here.
 		// The viewpoint was forcibly changed.
-		LUAh_ViewpointSwitch(&players[consoleplayer], &players[displayplayer], true);
-#endif
+		LUAh_ViewpointSwitch(&players[consoleplayer], &players[consoleplayer], true);
 		displayplayer = consoleplayer;
 	}
 
@@ -2535,9 +2575,7 @@ static void CL_RemovePlayer(INT32 playernum, kickreason_t reason)
 		RemoveAdminPlayer(playernum); // don't stay admin after you're gone
 	}
 
-#ifdef HAVE_BLUA
 	LUA_InvalidatePlayer(&players[playernum]);
-#endif
 
 	if (G_TagGametype()) //Check if you still have a game. Location flexible. =P
 		P_CheckSurvivors();
@@ -2792,16 +2830,13 @@ static void Command_Kick(void)
 		if (pn == -1 || pn == 0)
 			return;
 
-		if (server)
+		// Special case if we are trying to kick a player who is downloading the game state:
+		// trigger a timeout instead of kicking them, because a kick would only
+		// take effect after they have finished downloading
+		if (server && playernode[pn] != UINT8_MAX && sendingsavegame[playernode[pn]])
 		{
-			// Special case if we are trying to kick a player who is downloading the game state:
-			// trigger a timeout instead of kicking them, because a kick would only
-			// take effect after they have finished downloading
-			if (sendingsavegame[playernode[pn]])
-			{
-				Net_ConnectionTimeout(playernode[pn]);
-				return;
-			}
+			Net_ConnectionTimeout(playernode[pn]);
+			return;
 		}
 
 		WRITESINT8(p, pn);
@@ -2859,7 +2894,7 @@ static void Got_KickCmd(UINT8 **p, INT32 playernum)
 
 	// Is playernum authorized to make this kick?
 	if (playernum != serverplayer && !IsPlayerAdmin(playernum)
-		&& !(playerpernode[playernode[playernum]] == 2
+		&& !(playernode[playernum] != UINT8_MAX && playerpernode[playernode[playernum]] == 2
 		&& nodetoplayer2[playernode[playernum]] == pnum))
 	{
 		// We received a kick command from someone who isn't the
@@ -3018,7 +3053,7 @@ static void Got_KickCmd(UINT8 **p, INT32 playernum)
 	}
 	else if (keepbody)
 	{
-		if (server && !demoplayback)
+		if (server && !demoplayback && playernode[pnum] != UINT8_MAX)
 		{
 			INT32 node = playernode[pnum];
 			playerpernode[node]--;
@@ -3134,9 +3169,7 @@ void SV_ResetServer(void)
 
 	for (i = 0; i < MAXPLAYERS; i++)
 	{
-#ifdef HAVE_BLUA
 		LUA_InvalidatePlayer(&players[i]);
-#endif
 		playeringame[i] = false;
 		playernode[i] = UINT8_MAX;
 		memset(playeraddress[i], 0, sizeof(*playeraddress));
@@ -3197,10 +3230,8 @@ void D_QuitNetGame(void)
 
 	// abort send/receive of files
 	CloseNetFile();
-#ifdef HAVE_BLUA
 	RemoveAllLuaFileTransfers();
 	waitingforluafiletransfer = false;
-#endif
 
 	if (server)
 	{
@@ -3234,37 +3265,6 @@ void D_QuitNetGame(void)
 #endif
 }
 
-static INT32 FindRejoinerNum(SINT8 node)
-{
-	char strippednodeaddress[64];
-	const char *nodeaddress;
-	char *port;
-	INT32 i;
-
-	// Make sure there is no dead dress before proceeding to the stripping
-	if (!I_GetNodeAddress)
-		return -1;
-	nodeaddress = I_GetNodeAddress(node);
-	if (!nodeaddress)
-		return -1;
-
-	// Strip the address of its port
-	strcpy(strippednodeaddress, nodeaddress);
-	port = strchr(strippednodeaddress, ':');
-	if (port)
-		*port = '\0';
-
-	// Check if any player matches the stripped address
-	for (i = 0; i < MAXPLAYERS; i++)
-	{
-		if (playeringame[i] && playeraddress[i][0] && playernode[i] == UINT8_MAX
-		&& !strcmp(playeraddress[i], strippednodeaddress))
-			return i;
-	}
-
-	return -1;
-}
-
 // Adds a node to the game (player will follow at map change or at savegame....)
 static inline void SV_AddNode(INT32 node)
 {
@@ -3402,10 +3402,8 @@ static void Got_AddPlayer(UINT8 **p, INT32 playernum)
 	if (server && multiplayer && motd[0] != '\0')
 		COM_BufAddText(va("sayto %d %s\n", newplayernum, motd));
 
-#ifdef HAVE_BLUA
 	if (!rejoined)
 		LUAh_PlayerJoin(newplayernum);
-#endif
 }
 
 static boolean SV_AddWaitingPlayers(const char *name, const char *name2)
@@ -3595,7 +3593,7 @@ static void HandleConnect(SINT8 node)
 	rejoinernum = FindRejoinerNum(node);
 
 	if (bannednode && bannednode[node])
-		SV_SendRefuse(node, M_GetText("You have been banned\nfrom the server"));
+		SV_SendRefuse(node, M_GetText("You have been banned\nfrom the server."));
 	else if (netbuffer->u.clientcfg._255 != 255 ||
 			netbuffer->u.clientcfg.packetversion != PACKETVERSION)
 		SV_SendRefuse(node, "Incompatible packet formats.");
@@ -3606,17 +3604,15 @@ static void HandleConnect(SINT8 node)
 		|| netbuffer->u.clientcfg.subversion != SUBVERSION)
 		SV_SendRefuse(node, va(M_GetText("Different SRB2 versions cannot\nplay a netgame!\n(server version %d.%d.%d)"), VERSION/100, VERSION%100, SUBVERSION));
 	else if (!cv_allownewplayer.value && node && rejoinernum == -1)
-		SV_SendRefuse(node, M_GetText("The server is not accepting\njoins for the moment"));
+		SV_SendRefuse(node, M_GetText("The server is not accepting\njoins for the moment."));
 	else if (D_NumPlayers() >= cv_maxplayers.value && rejoinernum == -1)
 		SV_SendRefuse(node, va(M_GetText("Maximum players reached: %d"), cv_maxplayers.value));
 	else if (netgame && netbuffer->u.clientcfg.localplayers > 1) // Hacked client?
 		SV_SendRefuse(node, M_GetText("Too many players from\nthis node."));
 	else if (netgame && !netbuffer->u.clientcfg.localplayers) // Stealth join?
 		SV_SendRefuse(node, M_GetText("No players from\nthis node."));
-#ifdef HAVE_BLUA
 	else if (luafiletransfers)
 		SV_SendRefuse(node, M_GetText("The server is broadcasting a file\nrequested by a Lua script.\nPlease wait a bit and then\ntry rejoining."));
-#endif
 	else
 	{
 #ifndef NONET
@@ -4203,7 +4199,6 @@ static void HandlePacketFromPlayer(SINT8 node)
 			Net_CloseConnection(node);
 			nodeingame[node] = false;
 			break;
-#ifdef HAVE_BLUA
 		case PT_ASKLUAFILE:
 			if (server && luafiletransfers && luafiletransfers->nodestatus[node] == LFTNS_ASKED)
 			{
@@ -4216,7 +4211,6 @@ static void HandlePacketFromPlayer(SINT8 node)
 			if (server && luafiletransfers && luafiletransfers->nodestatus[node] == LFTNS_SENDING)
 				SV_HandleLuaFileSent(node);
 			break;
-#endif
 // -------------------------------------------- CLIENT RECEIVE ----------
 		case PT_RESYNCHEND:
 			// Only accept PT_RESYNCHEND from the server.
@@ -4344,12 +4338,10 @@ static void HandlePacketFromPlayer(SINT8 node)
 			if (client)
 				Got_Filetxpak();
 			break;
-#ifdef HAVE_BLUA
 		case PT_SENDINGLUAFILE:
 			if (client)
 				CL_PrepareDownloadLuaFile();
 			break;
-#endif
 		default:
 			DEBFILE(va("UNKNOWN PACKET TYPE RECEIVED %d from host %d\n",
 				netbuffer->packettype, node));
@@ -4971,7 +4963,7 @@ void NetUpdate(void)
 			PingUpdate();
 		// update node latency values so we can take an average later.
 		for (i = 0; i < MAXPLAYERS; i++)
-			if (playeringame[i])
+			if (playeringame[i] && playernode[i] != UINT8_MAX)
 				realpingtable[i] += G_TicsToMilliseconds(GetLag(playernode[i]));
 		pingmeasurecount++;
 	}
diff --git a/src/d_clisrv.h b/src/d_clisrv.h
index 42da896702b7a38578c253442ef33886832ab864..30d562bed2e0c39c74b3b9851e89401e5e650c84 100644
--- a/src/d_clisrv.h
+++ b/src/d_clisrv.h
@@ -27,7 +27,7 @@ This version is independent of the mod name, and standard
 version and subversion. It should only account for the
 basic fields of the packet, and change infrequently.
 */
-#define PACKETVERSION 2
+#define PACKETVERSION 3
 
 // Network play related stuff.
 // There is a data struct that stores network
@@ -36,7 +36,7 @@ basic fields of the packet, and change infrequently.
 //  be transmitted.
 
 // Networking and tick handling related.
-#define BACKUPTICS 32
+#define BACKUPTICS 96
 #define MAXTEXTCMD 256
 //
 // Packet structure
@@ -67,11 +67,9 @@ typedef enum
 	PT_RESYNCHEND,    // Player is now resynched and is being requested to remake the gametic
 	PT_RESYNCHGET,    // Player got resynch packet
 
-#ifdef HAVE_BLUA
 	PT_SENDINGLUAFILE, // Server telling a client Lua needs to open a file
 	PT_ASKLUAFILE,     // Client telling the server they don't have the file
 	PT_HASLUAFILE,     // Client telling the server they have the file
-#endif
 
 	// Add non-PT_CANFAIL packet types here to avoid breaking MS compatibility.
 
@@ -367,6 +365,7 @@ typedef struct
 	UINT8 subversion;
 	UINT8 numberofplayer;
 	UINT8 maxplayer;
+	UINT8 refusereason; // 0: joinable, 1: joins disabled, 2: full
 	char gametypename[24];
 	UINT8 modifiedgame;
 	UINT8 cheatsenabled;
diff --git a/src/d_main.c b/src/d_main.c
index 9cbcdc0c60c1fe138533eca97c444163c29115d2..40e7af22a76137170e8bd60cd0c6014d199fab59 100644
--- a/src/d_main.c
+++ b/src/d_main.c
@@ -91,9 +91,7 @@ int	snprintf(char *str, size_t n, const char *fmt, ...);
 #include "hardware/hw3sound.h"
 #endif
 
-#ifdef HAVE_BLUA
 #include "lua_script.h"
-#endif
 
 // platform independant focus loss
 UINT8 window_notinfocus = false;
@@ -746,9 +744,7 @@ void D_SRB2Loop(void)
 		HW3S_EndFrameUpdate();
 #endif
 
-#ifdef HAVE_BLUA
 		LUA_Step();
-#endif
 	}
 }
 
@@ -1124,9 +1120,7 @@ void D_SRB2Main(void)
 			// can't use sprintf since there is %u in savegamename
 			strcatbf(savegamename, srb2home, PATHSEP);
 
-#ifdef HAVE_BLUA
 			snprintf(luafiledir, sizeof luafiledir, "%s" PATHSEP "luafiles", srb2home);
-#endif
 #else // DEFAULTDIR
 			snprintf(srb2home, sizeof srb2home, "%s", userhome);
 			snprintf(downloaddir, sizeof downloaddir, "%s", userhome);
@@ -1138,9 +1132,7 @@ void D_SRB2Main(void)
 			// can't use sprintf since there is %u in savegamename
 			strcatbf(savegamename, userhome, PATHSEP);
 
-#ifdef HAVE_BLUA
 			snprintf(luafiledir, sizeof luafiledir, "%s" PATHSEP "luafiles", userhome);
-#endif
 #endif // DEFAULTDIR
 		}
 
diff --git a/src/d_net.c b/src/d_net.c
index 77a58e9bd60b16897ae96e3b13980120eb50dfc7..1db75f3da13e7bcd357054362cdd49094ac78d45 100644
--- a/src/d_net.c
+++ b/src/d_net.c
@@ -715,10 +715,8 @@ void Net_CloseConnection(INT32 node)
 
 	InitNode(&nodes[node]);
 	SV_AbortSendFiles(node);
-#ifdef HAVE_BLUA
 	if (server)
 		SV_AbortLuaFileTransfer(node);
-#endif
 	I_NetFreeNodenum(node);
 #endif
 }
@@ -803,11 +801,9 @@ static const char *packettypename[NUMPACKETTYPE] =
 	"RESYNCHEND",
 	"RESYNCHGET",
 
-#ifdef HAVE_BLUA
 	"SENDINGLUAFILE",
 	"ASKLUAFILE",
 	"HASLUAFILE",
-#endif
 
 	"FILEFRAGMENT",
 	"TEXTCMD",
diff --git a/src/d_netcmd.c b/src/d_netcmd.c
index c6ea974aeb5f4b31d330f49714a088cacba09645..aaa01c57f8ee7525eb752364641459c65154819c 100644
--- a/src/d_netcmd.c
+++ b/src/d_netcmd.c
@@ -22,7 +22,7 @@
 #include "g_input.h"
 #include "m_menu.h"
 #include "r_local.h"
-#include "r_things.h"
+#include "r_skins.h"
 #include "p_local.h"
 #include "p_setup.h"
 #include "s_sound.h"
@@ -157,10 +157,8 @@ static void Command_Isgamemodified_f(void);
 static void Command_Cheats_f(void);
 #ifdef _DEBUG
 static void Command_Togglemodified_f(void);
-#ifdef HAVE_BLUA
 static void Command_Archivetest_f(void);
 #endif
-#endif
 
 // =========================================================================
 //                           CLIENT VARIABLES
@@ -415,11 +413,9 @@ const char *netxcmdnames[MAXNETXCMD - 1] =
 	"DELFILE", // replace next time we add an XD
 	"SETMOTD",
 	"SUICIDE",
-#ifdef HAVE_BLUA
 	"LUACMD",
 	"LUAVAR",
 	"LUAFILE"
-#endif
 };
 
 // =========================================================================
@@ -452,10 +448,8 @@ void D_RegisterServerCommands(void)
 	RegisterNetXCmd(XD_PAUSE, Got_Pause);
 	RegisterNetXCmd(XD_SUICIDE, Got_Suicide);
 	RegisterNetXCmd(XD_RUNSOC, Got_RunSOCcmd);
-#ifdef HAVE_BLUA
 	RegisterNetXCmd(XD_LUACMD, Got_Luacmd);
 	RegisterNetXCmd(XD_LUAFILE, Got_LuaFile);
-#endif
 
 	// Remote Administration
 	COM_AddCommand("password", Command_Changepassword_f);
@@ -504,9 +498,7 @@ void D_RegisterServerCommands(void)
 	COM_AddCommand("cheats", Command_Cheats_f); // test
 #ifdef _DEBUG
 	COM_AddCommand("togglemodified", Command_Togglemodified_f);
-#ifdef HAVE_BLUA
 	COM_AddCommand("archivetest", Command_Archivetest_f);
-#endif
 #endif
 
 	// for master server connection
@@ -915,7 +907,7 @@ void D_RegisterClientCommands(void)
 #ifdef _DEBUG
 	COM_AddCommand("causecfail", Command_CauseCfail_f);
 #endif
-#if defined(HAVE_BLUA) && defined(LUA_ALLOW_BYTECODE)
+#ifdef LUA_ALLOW_BYTECODE
 	COM_AddCommand("dumplua", Command_Dumplua_f);
 #endif
 }
@@ -2029,9 +2021,7 @@ static void Got_Mapcmd(UINT8 **cp, INT32 playernum)
 	UINT8 flags;
 	INT32 resetplayer = 1, lastgametype;
 	UINT8 skipprecutscene, FLS;
-#ifdef HAVE_BLUA
 	INT16 mapnumber;
-#endif
 
 	if (playernum != serverplayer && !IsPlayerAdmin(playernum))
 	{
@@ -2093,10 +2083,8 @@ static void Got_Mapcmd(UINT8 **cp, INT32 playernum)
 		CV_StealthSetValue(&cv_playercolor, players[0].skincolor);
 	}
 
-#ifdef HAVE_BLUA
 	mapnumber = M_MapNumber(mapname[3], mapname[4]);
 	LUAh_MapChange(mapnumber);
-#endif
 
 	G_InitNew(ultimatemode, mapname, resetplayer, skipprecutscene, FLS);
 	if (demoplayback && !timingdemo)
@@ -2680,11 +2668,9 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
 		return;
 	}
 
-#ifdef HAVE_BLUA
 	// Don't switch team, just go away, please, go awaayyyy, aaauuauugghhhghgh
 	if (!LUAh_TeamSwitch(&players[playernum], NetPacket.packet.newteam, players[playernum].spectator, NetPacket.packet.autobalance, NetPacket.packet.scrambled))
 		return;
-#endif
 
 	//no status changes after hidetime
 	if ((gametyperules & GTR_HIDEFROZEN) && (leveltime >= (hidetime * TICRATE)))
@@ -2841,12 +2827,10 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
 	//reset view if you are changed, or viewing someone who was changed.
 	if (playernum == consoleplayer || displayplayer == playernum)
 	{
-#ifdef HAVE_BLUA
 		// Call ViewpointSwitch hooks here.
 		// The viewpoint was forcibly changed.
 		if (displayplayer != consoleplayer) // You're already viewing yourself. No big deal.
-			LUAh_ViewpointSwitch(&players[playernum], &players[displayplayer], true);
-#endif
+			LUAh_ViewpointSwitch(&players[consoleplayer], &players[consoleplayer], true);
 		displayplayer = consoleplayer;
 	}
 
@@ -3344,10 +3328,6 @@ static void Got_RequestAddfilecmd(UINT8 **cp, INT32 playernum)
 	boolean kick = false;
 	boolean toomany = false;
 	INT32 i,j;
-	serverinfo_pak *dummycheck = NULL;
-
-	// Shut the compiler up.
-	(void)dummycheck;
 
 	READSTRINGN(*cp, filename, 240);
 	READMEM(*cp, md5sum, 16);
@@ -3755,11 +3735,11 @@ static void ExitMove_OnChange(void)
 			{
 				if (players[i].mo->target && players[i].mo->target->type == MT_SIGN)
 					P_SetTarget(&players[i].mo->target, NULL);
-				
+
 				if (players[i].pflags & PF_FINISHED)
 					P_GiveFinishFlags(&players[i]);
 			}
-			
+
 		CONS_Printf(M_GetText("Players can now move after completing the level.\n"));
 	}
 	else
@@ -4336,7 +4316,6 @@ static void Command_Togglemodified_f(void)
 	modifiedgame = !modifiedgame;
 }
 
-#ifdef HAVE_BLUA
 extern UINT8 *save_p;
 static void Command_Archivetest_f(void)
 {
@@ -4381,7 +4360,6 @@ static void Command_Archivetest_f(void)
 	CONS_Printf("Done. No crash.\n");
 }
 #endif
-#endif
 
 /** Makes a change to ::cv_forceskin take effect immediately.
   *
diff --git a/src/d_netcmd.h b/src/d_netcmd.h
index 6e6ae0c0a9530a1d9f937f0865839cfc5f57edef..897c28968e7a42662ad04b533942005fb70f91d2 100644
--- a/src/d_netcmd.h
+++ b/src/d_netcmd.h
@@ -142,11 +142,9 @@ typedef enum
 	XD_SETMOTD,     // 19
 	XD_SUICIDE,     // 20
 	XD_DEMOTED,     // 21
-#ifdef HAVE_BLUA
 	XD_LUACMD,      // 22
 	XD_LUAVAR,      // 23
 	XD_LUAFILE,     // 24
-#endif
 	MAXNETXCMD
 } netxcmd_t;
 
diff --git a/src/d_netfil.c b/src/d_netfil.c
index 9ce423cd43a72192ff19425ae315b462dcff4a3e..6d3ac7f9d02705539bff9afd890d911d5088346e 100644
--- a/src/d_netfil.c
+++ b/src/d_netfil.c
@@ -95,11 +95,9 @@ char downloaddir[512] = "DOWNLOAD";
 INT32 lastfilenum = -1;
 #endif
 
-#ifdef HAVE_BLUA
 luafiletransfer_t *luafiletransfers = NULL;
 boolean waitingforluafiletransfer = false;
 char luafiledir[256 + 16] = "luafiles";
-#endif
 
 
 /** Fills a serverinfo packet with information about wad files loaded.
@@ -458,7 +456,6 @@ void CL_LoadServerFiles(void)
 	}
 }
 
-#ifdef HAVE_BLUA
 void AddLuaFileTransfer(const char *filename, const char *mode)
 {
 	luafiletransfer_t **prevnext; // A pointer to the "next" field of the last transfer in the list
@@ -614,7 +611,6 @@ void CL_PrepareDownloadLuaFile(void)
 	// Make sure all directories in the file path exist
 	MakePathDirs(fileneeded[0].filename);
 }
-#endif
 
 // Number of files to send
 // Little optimization to quickly test if there is a file in the queue
@@ -749,7 +745,6 @@ void SV_SendRam(INT32 node, void *data, size_t size, freemethod_t freemethod, UI
 	filestosend++;
 }
 
-#ifdef HAVE_BLUA
 /** Adds a file requested by Lua to the file list for a node
   *
   * \param node The node to send the file to
@@ -798,7 +793,6 @@ boolean SV_SendLuaFile(INT32 node, const char *filename, boolean textmode)
 	filestosend++;
 	return true;
 }
-#endif
 
 /** Stops sending a file for a node, and removes the file request from the list,
   * either because the file has been fully sent or because the node was disconnected
@@ -1035,14 +1029,12 @@ void Got_Filetxpak(void)
 			file->status = FS_FOUND;
 			CONS_Printf(M_GetText("Downloading %s...(done)\n"),
 				filename);
-#ifdef HAVE_BLUA
 			if (luafiletransfers)
 			{
 				// Tell the server we have received the file
 				netbuffer->packettype = PT_HASLUAFILE;
 				HSendPacket(servernode, true, 0, 0);
 			}
-#endif
 		}
 	}
 	else
diff --git a/src/d_netfil.h b/src/d_netfil.h
index f0a7cf8cc60feff8fe21a64ddd36624c882c4908..7d6efada03cde57a29791257a126363d0ffb6d8d 100644
--- a/src/d_netfil.h
+++ b/src/d_netfil.h
@@ -72,7 +72,6 @@ boolean CL_CheckDownloadable(void);
 boolean CL_SendRequestFile(void);
 boolean Got_RequestFilePak(INT32 node);
 
-#ifdef HAVE_BLUA
 typedef enum
 {
 	LFTNS_WAITING, // This node is waiting for the server to send the file
@@ -108,7 +107,6 @@ void Got_LuaFile(UINT8 **cp, INT32 playernum);
 void StoreLuaFileCallback(INT32 id);
 void RemoveLuaFileCallback(INT32 id);
 void MakePathDirs(char *path);
-#endif
 
 void SV_AbortSendFiles(INT32 node);
 void CloseNetFile(void);
diff --git a/src/dehacked.c b/src/dehacked.c
index 5d29ca280e50bf253a5a967e45bc03ff5758562c..c6cd0b9e5e3a9f8fb5e90a18e85b92de4b1efc2d 100644
--- a/src/dehacked.c
+++ b/src/dehacked.c
@@ -31,6 +31,7 @@
 #include "r_data.h"
 #include "r_draw.h"
 #include "r_patch.h"
+#include "r_things.h" // R_Char2Frame
 #include "r_sky.h"
 #include "fastcmp.h"
 #include "lua_script.h"
@@ -39,9 +40,7 @@
 
 #include "m_cond.h"
 
-#ifdef HAVE_BLUA
 #include "v_video.h" // video flags (for lua)
-#endif
 
 #ifdef HWRENDER
 #include "hardware/hw_light.h"
@@ -76,10 +75,8 @@ static UINT16 get_mus(const char *word, UINT8 dehacked_mode);
 #endif
 static hudnum_t get_huditem(const char *word);
 static menutype_t get_menutype(const char *word);
-#ifndef HAVE_BLUA
-static INT16 get_gametype(const char *word);
-static powertype_t get_power(const char *word);
-#endif
+//static INT16 get_gametype(const char *word);
+//static powertype_t get_power(const char *word);
 
 boolean deh_loaded = false;
 static int dbg_line;
@@ -1415,7 +1412,6 @@ static void readlevelheader(MYFILE *f, INT32 num)
 			// Lua custom options also go above, contents may be case sensitive.
 			if (fastncmp(word, "LUA.", 4))
 			{
-#ifdef HAVE_BLUA
 				UINT8 j;
 				customoption_t *modoption;
 
@@ -1449,9 +1445,6 @@ static void readlevelheader(MYFILE *f, INT32 num)
 				modoption->option[31] = '\0';
 				strncpy(modoption->value,  word2, 255);
 				modoption->value[255] = '\0';
-#else
-				// Silently ignore.
-#endif
 				continue;
 			}
 
@@ -3123,22 +3116,20 @@ static void readframe(MYFILE *f, INT32 num)
 				}
 
 				z = 0;
-#ifdef HAVE_BLUA
 				found = LUA_SetLuaAction(&states[num], actiontocompare);
 				if (!found)
-#endif
-				while (actionpointers[z].name)
-				{
-					if (fastcmp(actiontocompare, actionpointers[z].name))
+					while (actionpointers[z].name)
 					{
-						states[num].action = actionpointers[z].action;
-						states[num].action.acv = actionpointers[z].action.acv; // assign
-						states[num].action.acp1 = actionpointers[z].action.acp1;
-						found = true;
-						break;
+						if (fastcmp(actiontocompare, actionpointers[z].name))
+						{
+							states[num].action = actionpointers[z].action;
+							states[num].action.acv = actionpointers[z].action.acv; // assign
+							states[num].action.acp1 = actionpointers[z].action.acp1;
+							found = true;
+							break;
+						}
+						z++;
 					}
-					z++;
-				}
 
 				if (!found)
 					deh_warning("Unknown action %s", actiontocompare);
@@ -8848,14 +8839,12 @@ static const char *const MOBJEFLAG_LIST[] = {
 	NULL
 };
 
-#ifdef HAVE_BLUA
 static const char *const MAPTHINGFLAG_LIST[4] = {
 	"EXTRA", // Extra flag for objects.
 	"OBJECTFLIP", // Reverse gravity flag for objects.
 	"OBJECTSPECIAL", // Special flag used with certain objects.
 	"AMBUSH" // Deaf monsters/do not react to sound.
 };
-#endif
 
 static const char *const PLAYERFLAG_LIST[] = {
 
@@ -8952,7 +8941,6 @@ static const char *const GAMETYPERULE_LIST[] = {
 	NULL
 };
 
-#ifdef HAVE_BLUA
 // Linedef flags
 static const char *const ML_LIST[16] = {
 	"IMPASSIBLE",
@@ -8972,7 +8960,6 @@ static const char *const ML_LIST[16] = {
 	"BOUNCY",
 	"TFERLINE"
 };
-#endif
 
 // This DOES differ from r_draw's Color_Names, unfortunately.
 // Also includes Super colors
@@ -9271,11 +9258,7 @@ static const char *const MENUTYPES_LIST[] = {
 struct {
 	const char *n;
 	// has to be able to hold both fixed_t and angle_t, so drastic measure!!
-#ifdef HAVE_BLUA
 	lua_Integer v;
-#else
-	INT64 v;
-#endif
 } const INT_CONST[] = {
 	// If a mod removes some variables here,
 	// please leave the names in-tact and just set
@@ -9531,7 +9514,6 @@ struct {
 	{"ME_ULTIMATE",ME_ULTIMATE},
 	{"ME_PERFECT",ME_PERFECT},
 
-#ifdef HAVE_BLUA
 	// p_local.h constants
 	{"FLOATSPEED",FLOATSPEED},
 	{"MAXSTEPMOVE",MAXSTEPMOVE},
@@ -9696,11 +9678,10 @@ struct {
 	// Node flags
 	{"NF_SUBSECTOR",NF_SUBSECTOR}, // Indicate a leaf.
 #endif
-#ifdef ESLOPE
+
 	// Slope flags
 	{"SL_NOPHYSICS",SL_NOPHYSICS},
 	{"SL_DYNAMIC",SL_DYNAMIC},
-#endif
 
 	// Angles
 	{"ANG1",ANG1},
@@ -9864,7 +9845,6 @@ struct {
 	{"TC_RAINBOW",TC_RAINBOW},
 	{"TC_BLINK",TC_BLINK},
 	{"TC_DASHMODE",TC_DASHMODE},
-#endif
 
 	{NULL,0}
 };
@@ -10021,8 +10001,7 @@ static menutype_t get_menutype(const char *word)
 	return MN_NONE;
 }
 
-#ifndef HAVE_BLUA
-static INT16 get_gametype(const char *word)
+/*static INT16 get_gametype(const char *word)
 { // Returns the value of GT_ enumerations
 	INT16 i;
 	if (*word >= '0' && *word <= '9')
@@ -10048,7 +10027,7 @@ static powertype_t get_power(const char *word)
 			return i;
 	deh_warning("Couldn't find power named 'pw_%s'",word);
 	return pw_invulnerability;
-}
+}*/
 
 /// \todo Make ANY of this completely over-the-top math craziness obey the order of operations.
 static fixed_t op_mul(fixed_t a, fixed_t b) { return a*b; }
@@ -10076,7 +10055,7 @@ struct {
 };
 
 // Returns the full word, cut at the first symbol or whitespace
-static char *read_word(const char *line)
+/*static char *read_word(const char *line)
 {
 	// Part 1: You got the start of the word, now find the end.
   const char *p;
@@ -10306,16 +10285,14 @@ static fixed_t find_const(const char **rword)
 	const_warning("constant",word);
 	free(word);
 	return 0;
-}
-#endif
+}*/
 
 // Loops through every constant and operation in word and performs its calculations, returning the final value.
 fixed_t get_number(const char *word)
 {
-#ifdef HAVE_BLUA
 	return LUA_EvalMath(word);
-#else
-	// DESPERATELY NEEDED: Order of operations support! :x
+
+	/*// DESPERATELY NEEDED: Order of operations support! :x
 	fixed_t i = find_const(&word);
 	INT32 o;
 	while(*word) {
@@ -10325,8 +10302,7 @@ fixed_t get_number(const char *word)
 		else
 			break;
 	}
-	return i;
-#endif
+	return i;*/
 }
 
 void DEH_Check(void)
@@ -10351,7 +10327,6 @@ void DEH_Check(void)
 #endif
 }
 
-#ifdef HAVE_BLUA
 #include "lua_script.h"
 #include "lua_libs.h"
 
@@ -10977,5 +10952,3 @@ void LUA_SetActionByName(void *state, const char *actiontocompare)
 		}
 	}
 }
-
-#endif // HAVE_BLUA
diff --git a/src/dehacked.h b/src/dehacked.h
index 80c31f3de9e53d23175f2df2e2770175dc0409bc..54225f36e8c851b67e968b3b25167ac1acf61306 100644
--- a/src/dehacked.h
+++ b/src/dehacked.h
@@ -34,11 +34,9 @@ void DEH_Check(void);
 
 fixed_t get_number(const char *word);
 
-#ifdef HAVE_BLUA
 boolean LUA_SetLuaAction(void *state, const char *actiontocompare);
 const char *LUA_GetActionName(void *action);
 void LUA_SetActionByName(void *state, const char *actiontocompare);
-#endif
 
 extern boolean deh_loaded;
 
diff --git a/src/doomdef.h b/src/doomdef.h
index 71c8850192d9a94dc00b4dc640b85bf595946d64..2ed66aecc90763f562a8d59937754ad934dd7831 100644
--- a/src/doomdef.h
+++ b/src/doomdef.h
@@ -562,14 +562,9 @@ extern const char *compdate, *comptime, *comprevision, *compbranch;
 // None of these that are disabled in the normal build are guaranteed to work perfectly
 // Compile them at your own risk!
 
-/// Kalaron/Eternity Engine slope code (SRB2CB ported)
-#define ESLOPE
-
-#ifdef ESLOPE
 /// Backwards compatibility with SRB2CB's slope linedef types.
 ///	\note	A simple shim that prints a warning.
 #define ESLOPE_TYPESHIM
-#endif
 
 ///	Allows the use of devmode in multiplayer. AKA "fishcake"
 //#define NETGAME_DEVMODE
diff --git a/src/doomstat.h b/src/doomstat.h
index b7388fd96255374e59fc0c1384b5dc6d4db9f252..893514b328be964abf78b3a545e088609967368a 100644
--- a/src/doomstat.h
+++ b/src/doomstat.h
@@ -493,7 +493,6 @@ extern UINT16 emeralds;
 #define EMERALD7 64
 #define ALL7EMERALDS(v) ((v & (EMERALD1|EMERALD2|EMERALD3|EMERALD4|EMERALD5|EMERALD6|EMERALD7)) == (EMERALD1|EMERALD2|EMERALD3|EMERALD4|EMERALD5|EMERALD6|EMERALD7))
 
-// yes, even in non HAVE_BLUA
 #define NUM_LUABANKS 16 // please only make this number go up between versions, never down. you'll break saves otherwise. also, must fit in UINT8
 extern INT32 luabanks[NUM_LUABANKS];
 
diff --git a/src/f_finale.c b/src/f_finale.c
index c98d49842d2dac4a5749723b26e90975b004f338..95535a7ea3b09becf96e6de832ea6f7f004edbf7 100644
--- a/src/f_finale.c
+++ b/src/f_finale.c
@@ -39,9 +39,7 @@
 #include "fastcmp.h"
 #include "console.h"
 
-#ifdef HAVE_BLUA
 #include "lua_hud.h"
-#endif
 
 // Stage of animation:
 // 0 = text, 1 = art screen
@@ -2762,11 +2760,7 @@ void F_TitleScreenDrawer(void)
 	// rei|miru: use title pics?
 	hidepics = curhidepics;
 	if (hidepics)
-#ifdef HAVE_BLUA
 		goto luahook;
-#else
-		return;
-#endif
 
 	switch(curttmode)
 	{
@@ -3488,10 +3482,8 @@ void F_TitleScreenDrawer(void)
 			break;
 	}
 
-#ifdef HAVE_BLUA
 luahook:
 	LUAh_TitleHUD();
-#endif
 }
 
 // separate animation timer for backgrounds, since we also count
diff --git a/src/f_wipe.c b/src/f_wipe.c
index 8d12262efb2d6377395ac06c7c6d37d2f6ed48a5..08d7ed9913cf0f02058ea74d4906076ad205bf4f 100644
--- a/src/f_wipe.c
+++ b/src/f_wipe.c
@@ -16,6 +16,7 @@
 #include "i_video.h"
 #include "v_video.h"
 
+#include "r_state.h" // fadecolormap
 #include "r_draw.h" // transtable
 #include "p_pspr.h" // tr_transxxx
 #include "p_local.h"
@@ -32,9 +33,7 @@
 
 #include "doomstat.h"
 
-#ifdef HAVE_BLUA
 #include "lua_hud.h" // level title
-#endif
 
 #ifdef HWRENDER
 #include "hardware/hw_main.h"
diff --git a/src/filesrch.h b/src/filesrch.h
index 4186271b038d23aac0ad9a1f77a0a3b368914ada..dfea8979e9c19d3a5a733e8303636762c9027d04 100644
--- a/src/filesrch.h
+++ b/src/filesrch.h
@@ -60,7 +60,7 @@ typedef enum
 #endif
 	EXT_PK3,
 	EXT_SOC,
-	EXT_LUA, // allowed even if not HAVE_BLUA so that we can yell on load attempt
+	EXT_LUA,
 	NUM_EXT,
 	NUM_EXT_TABLE = NUM_EXT-EXT_START,
 	EXT_LOADED = 0x80
diff --git a/src/g_game.c b/src/g_game.c
index 6d8826f1c5ffb29a808f1cea0cacf870684e1f80..bf73f6ce24cde224f797a294b36bde86b356f509 100644
--- a/src/g_game.c
+++ b/src/g_game.c
@@ -38,7 +38,7 @@
 #include "byteptr.h"
 #include "i_joy.h"
 #include "r_local.h"
-#include "r_things.h"
+#include "r_skins.h"
 #include "y_inter.h"
 #include "v_video.h"
 #include "dehacked.h" // get_number (for ghost thok)
@@ -47,9 +47,7 @@
 #include "m_cond.h" // condition sets
 #include "md5.h" // demo checksums
 
-#ifdef HAVE_BLUA
 #include "lua_hud.h"
-#endif
 
 gameaction_t gameaction;
 gamestate_t gamestate = GS_NULL;
@@ -177,7 +175,7 @@ static boolean retryingmodeattack = false;
 UINT8 stagefailed; // Used for GEMS BONUS? Also to see if you beat the stage.
 
 UINT16 emeralds;
-INT32 luabanks[NUM_LUABANKS]; // yes, even in non HAVE_BLUA
+INT32 luabanks[NUM_LUABANKS];
 UINT32 token; // Number of tokens collected in a level
 UINT32 tokenlist; // List of tokens collected
 boolean gottoken; // Did you get a token? Used for end of act
@@ -1044,18 +1042,17 @@ static INT32 G_BasicDeadZoneCalculation(INT32 magnitude, fixed_t deadZone)
 {
 	const INT32 jdeadzone = (JOYAXISRANGE * deadZone) / FRACUNIT;
 	INT32 deadzoneAppliedValue = 0;
+	INT32 adjustedMagnitude = abs(magnitude);
 
-	if (jdeadzone > 0)
+	if (jdeadzone >= JOYAXISRANGE && adjustedMagnitude >= JOYAXISRANGE) // If the deadzone and magnitude are both 100%...
+		return JOYAXISRANGE; // ...return 100% input directly, to avoid dividing by 0
+	else if (adjustedMagnitude > jdeadzone) // Otherwise, calculate how much the magnitude exceeds the deadzone
 	{
-		if (magnitude > jdeadzone)
-		{
-			INT32 adjustedMagnitude = abs(magnitude);
-			adjustedMagnitude = min(adjustedMagnitude, JOYAXISRANGE);
+		adjustedMagnitude = min(adjustedMagnitude, JOYAXISRANGE);
 
-			adjustedMagnitude -= jdeadzone;
+		adjustedMagnitude -= jdeadzone;
 
-			deadzoneAppliedValue = (adjustedMagnitude * JOYAXISRANGE) / (JOYAXISRANGE - jdeadzone);
-		}
+		deadzoneAppliedValue = (adjustedMagnitude * JOYAXISRANGE) / (JOYAXISRANGE - jdeadzone);
 	}
 
 	return deadzoneAppliedValue;
@@ -1715,11 +1712,9 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
 	if (ssplayer == 1 && (cmd->forwardmove || cmd->sidemove || cmd->buttons)
 		&& displayplayer != consoleplayer)
 	{
-#ifdef HAVE_BLUA
 		// Call ViewpointSwitch hooks here.
 		// The viewpoint was forcibly changed.
-		LUAh_ViewpointSwitch(player, &players[displayplayer], true);
-#endif
+		LUAh_ViewpointSwitch(player, &players[consoleplayer], true);
 		displayplayer = consoleplayer;
 	}
 }
@@ -2049,9 +2044,7 @@ boolean G_Responder(event_t *ev)
 		&& (ev->data1 == KEY_F12 || ev->data1 == gamecontrol[gc_viewpoint][0] || ev->data1 == gamecontrol[gc_viewpoint][1]))
 	{
 		// ViewpointSwitch Lua hook.
-#ifdef HAVE_BLUA
 		UINT8 canSwitchView = 0;
-#endif
 
 		if (splitscreen || !netgame)
 			displayplayer = consoleplayer;
@@ -2067,14 +2060,12 @@ boolean G_Responder(event_t *ev)
 				if (!playeringame[displayplayer])
 					continue;
 
-#ifdef HAVE_BLUA
 				// Call ViewpointSwitch hooks here.
 				canSwitchView = LUAh_ViewpointSwitch(&players[consoleplayer], &players[displayplayer], false);
 				if (canSwitchView == 1) // Set viewpoint to this player
 					break;
 				else if (canSwitchView == 2) // Skip this player
 					continue;
-#endif
 
 				if (players[displayplayer].spectator)
 					continue;
@@ -2674,9 +2665,7 @@ void G_SpawnPlayer(INT32 playernum)
 
 	P_SpawnPlayer(playernum);
 	G_MovePlayerToSpawnOrStarpost(playernum);
-#ifdef HAVE_BLUA
 	LUAh_PlayerSpawn(&players[playernum]); // Lua hook for player spawning :)
-#endif
 }
 
 void G_MovePlayerToSpawnOrStarpost(INT32 playernum)
@@ -3030,9 +3019,7 @@ void G_DoReborn(INT32 playernum)
 		}
 		else
 		{
-#ifdef HAVE_BLUA
 			LUAh_MapChange(gamemap);
-#endif
 			titlecardforreload = true;
 			G_DoLoadLevel(true);
 			titlecardforreload = false;
@@ -6804,9 +6791,7 @@ void G_DoPlayDemo(char *defdemoname)
 	// Set skin
 	SetPlayerSkin(0, skin);
 
-#ifdef HAVE_BLUA
 	LUAh_MapChange(gamemap);
-#endif
 	displayplayer = consoleplayer = 0;
 	memset(playeringame,0,sizeof(playeringame));
 	playeringame[0] = true;
diff --git a/src/hardware/hw3sound.c b/src/hardware/hw3sound.c
index f7c6e1da025e1db33471bd8775bc6a8ff4c826a3..7858640c018ac1c15609e7b0387c182efaf868cb 100644
--- a/src/hardware/hw3sound.c
+++ b/src/hardware/hw3sound.c
@@ -28,7 +28,7 @@
 #include "../tables.h"
 #include "../sounds.h"
 #include "../r_main.h"
-#include "../r_things.h"
+#include "../r_skins.h"
 #include "../m_random.h"
 #include "../p_local.h"
 #include "hw3dsdrv.h"
diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c
index ec87539708556dcf2f52f376e6cae2ded52c43b2..12c78e9a41a2a87b64ca0c5ffac6c37c6756da97 100644
--- a/src/hardware/hw_main.c
+++ b/src/hardware/hw_main.c
@@ -42,9 +42,7 @@
 #include "../m_cheat.h"
 #include "../f_finale.h"
 #include "../r_things.h" // R_GetShadowZ
-#ifdef ESLOPE
 #include "../p_slopes.h"
-#endif
 #include "hw_md2.h"
 
 #ifdef NEWCLIP
@@ -486,9 +484,7 @@ static void HWR_RenderPlane(sector_t *sector, extrasubsector_t *xsub, boolean is
 	angle_t angle = 0;
 	FSurfaceInfo    Surf;
 	fixed_t tempxsow, tempytow;
-#ifdef ESLOPE
 	pslope_t *slope = NULL;
-#endif
 
 	static FOutVector *planeVerts = NULL;
 	static UINT16 numAllocedPlaneVerts = 0;
@@ -499,7 +495,6 @@ static void HWR_RenderPlane(sector_t *sector, extrasubsector_t *xsub, boolean is
 	if (!xsub->planepoly)
 		return;
 
-#ifdef ESLOPE
 	// Get the slope pointer to simplify future code
 	if (FOFsector)
 	{
@@ -519,7 +514,6 @@ static void HWR_RenderPlane(sector_t *sector, extrasubsector_t *xsub, boolean is
 	// Set fixedheight to the slope's height from our viewpoint, if we have a slope
 	if (slope)
 		fixedheight = P_GetZAt(slope, viewx, viewy);
-#endif
 
 	height = FIXED_TO_FLOAT(fixedheight);
 
@@ -669,13 +663,11 @@ static void HWR_RenderPlane(sector_t *sector, extrasubsector_t *xsub, boolean is
 		v3d->y = height;
 		v3d->z = pv->y;
 
-#ifdef ESLOPE
 		if (slope)
 		{
 			fixedheight = P_GetZAt(slope, FLOAT_TO_FIXED(pv->x), FLOAT_TO_FIXED(pv->y));
 			v3d->y = FIXED_TO_FLOAT(fixedheight);
 		}
-#endif
 	}
 
 	// only useful for flat coloured triangles
@@ -693,10 +685,8 @@ static void HWR_RenderPlane(sector_t *sector, extrasubsector_t *xsub, boolean is
 	{
 		sector_t *psector = gr_frontsector;
 
-#ifdef ESLOPE
 		if (slope)
 			fixedheight = P_GetZAt(slope, psector->soundorg.x, psector->soundorg.y);
-#endif
 
 		if (psector->ffloors)
 		{
@@ -1069,7 +1059,6 @@ static void HWR_SplitWall(sector_t *sector, wallVert3D *wallVerts, INT32 texnum,
 	float pegt, pegb, pegmul;
 	float height = 0.0f, bheight = 0.0f;
 
-#ifdef ESLOPE
 	float endrealtop, endrealbot, endtop, endbot;
 	float endpegt, endpegb, endpegmul;
 	float endheight = 0.0f, endbheight = 0.0f;
@@ -1077,7 +1066,6 @@ static void HWR_SplitWall(sector_t *sector, wallVert3D *wallVerts, INT32 texnum,
 	// compiler complains when P_GetZAt is used in FLOAT_TO_FIXED directly
 	// use this as a temp var to store P_GetZAt's return value each time
 	fixed_t temp;
-#endif
 
 	fixed_t v1x = FLOAT_TO_FIXED(wallVerts[0].x);
 	fixed_t v1y = FLOAT_TO_FIXED(wallVerts[0].z); // not a typo
@@ -1096,23 +1084,18 @@ static void HWR_SplitWall(sector_t *sector, wallVert3D *wallVerts, INT32 texnum,
 	pegb = wallVerts[0].t;
 	pegmul = (pegb - pegt) / (top - bot);
 
-#ifdef ESLOPE
 	endrealtop = endtop = wallVerts[2].y;
 	endrealbot = endbot = wallVerts[1].y;
 	endpegt = wallVerts[2].t;
 	endpegb = wallVerts[1].t;
 	endpegmul = (endpegb - endpegt) / (endtop - endbot);
-#endif
 
 	for (i = 0; i < sector->numlights; i++)
 	{
-#ifdef ESLOPE
-        if (endtop < endrealbot)
-#endif
-		if (top < realbot)
+        if (endtop < endrealbot && top < realbot)
 			return;
 
-	// There's a compiler warning here if this comment isn't here because of indentation
+		// There's a compiler warning here if this comment isn't here because of indentation
 		if (!(list[i].flags & FF_NOSHADE))
 		{
 			if (pfloor && (pfloor->flags & FF_FOG))
@@ -1144,7 +1127,6 @@ static void HWR_SplitWall(sector_t *sector, wallVert3D *wallVerts, INT32 texnum,
 		else
 			solid = false;
 
-#ifdef ESLOPE
 		if (list[i].slope)
 		{
 			temp = P_GetZAt(list[i].slope, v1x, v1y);
@@ -1166,26 +1148,15 @@ static void HWR_SplitWall(sector_t *sector, wallVert3D *wallVerts, INT32 texnum,
 			else
 				bheight = endbheight = FIXED_TO_FLOAT(*list[i].caster->bottomheight);
 		}
-#else
-		height = FIXED_TO_FLOAT(list[i].height);
-		if (solid)
-			bheight = FIXED_TO_FLOAT(*list[i].caster->bottomheight);
-#endif
 
-#ifdef ESLOPE
-		if (endheight >= endtop)
-#endif
-		if (height >= top)
+		if (endheight >= endtop && height >= top)
 		{
 			if (solid && top > bheight)
 				top = bheight;
-#ifdef ESLOPE
 			if (solid && endtop > endbheight)
 				endtop = endbheight;
-#endif
 		}
 
-#ifdef ESLOPE
 		if (i + 1 < sector->numlights)
 		{
 			if (list[i+1].slope)
@@ -1203,21 +1174,8 @@ static void HWR_SplitWall(sector_t *sector, wallVert3D *wallVerts, INT32 texnum,
 			bheight = realbot;
 			endbheight = endrealbot;
 		}
-#else
-		if (i + 1 < sector->numlights)
-		{
-			bheight = FIXED_TO_FLOAT(list[i+1].height);
-		}
-		else
-		{
-			bheight = realbot;
-		}
-#endif
 
-#ifdef ESLOPE
-		if (endbheight >= endtop)
-#endif
-		if (bheight >= top)
+		if (endbheight >= endtop && bheight >= top)
 			continue;
 
 		//Found a break;
@@ -1226,15 +1184,12 @@ static void HWR_SplitWall(sector_t *sector, wallVert3D *wallVerts, INT32 texnum,
 		if (bot < realbot)
 			bot = realbot;
 
-#ifdef ESLOPE
 		endbot = endbheight;
 
 		if (endbot < endrealbot)
 			endbot = endrealbot;
-#endif
 		Surf->FlatColor.s.alpha = alpha;
 
-#ifdef ESLOPE
 		wallVerts[3].t = pegt + ((realtop - top) * pegmul);
 		wallVerts[2].t = endpegt + ((endrealtop - endtop) * endpegmul);
 		wallVerts[0].t = pegt + ((realtop - bot) * pegmul);
@@ -1245,14 +1200,6 @@ static void HWR_SplitWall(sector_t *sector, wallVert3D *wallVerts, INT32 texnum,
 		wallVerts[2].y = endtop;
 		wallVerts[0].y = bot;
 		wallVerts[1].y = endbot;
-#else
-		wallVerts[3].t = wallVerts[2].t = pegt + ((realtop - top) * pegmul);
-		wallVerts[0].t = wallVerts[1].t = pegt + ((realtop - bot) * pegmul);
-
-		// set top/bottom coords
-		wallVerts[2].y = wallVerts[3].y = top;
-		wallVerts[0].y = wallVerts[1].y = bot;
-#endif
 
 		if (cutflag & FF_FOG)
 			HWR_AddTransparentWall(wallVerts, Surf, texnum, PF_Fog|PF_NoTexture, true, lightnum, colormap);
@@ -1262,22 +1209,16 @@ static void HWR_SplitWall(sector_t *sector, wallVert3D *wallVerts, INT32 texnum,
 			HWR_ProjectWall(wallVerts, Surf, PF_Masked, lightnum, colormap);
 
 		top = bot;
-#ifdef ESLOPE
 		endtop = endbot;
-#endif
 	}
 
 	bot = realbot;
-#ifdef ESLOPE
 	endbot = endrealbot;
-	if (endtop <= endrealbot)
-#endif
-	if (top <= realbot)
+	if (endtop <= endrealbot && top <= realbot)
 		return;
 
 	Surf->FlatColor.s.alpha = alpha;
 
-#ifdef ESLOPE
 	wallVerts[3].t = pegt + ((realtop - top) * pegmul);
 	wallVerts[2].t = endpegt + ((endrealtop - endtop) * endpegmul);
 	wallVerts[0].t = pegt + ((realtop - bot) * pegmul);
@@ -1288,14 +1229,6 @@ static void HWR_SplitWall(sector_t *sector, wallVert3D *wallVerts, INT32 texnum,
 	wallVerts[2].y = endtop;
 	wallVerts[0].y = bot;
 	wallVerts[1].y = endbot;
-#else
-    wallVerts[3].t = wallVerts[2].t = pegt + ((realtop - top) * pegmul);
-    wallVerts[0].t = wallVerts[1].t = pegt + ((realtop - bot) * pegmul);
-
-    // set top/bottom coords
-    wallVerts[2].y = wallVerts[3].y = top;
-    wallVerts[0].y = wallVerts[1].y = bot;
-#endif
 
 	if (cutflag & FF_FOG)
 		HWR_AddTransparentWall(wallVerts, Surf, texnum, PF_Fog|PF_NoTexture, true, lightnum, colormap);
@@ -1340,19 +1273,15 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
 
 	fixed_t worldtop, worldbottom;
 	fixed_t worldhigh = 0, worldlow = 0;
-#ifdef ESLOPE
 	fixed_t worldtopslope, worldbottomslope;
 	fixed_t worldhighslope = 0, worldlowslope = 0;
 	fixed_t v1x, v1y, v2x, v2y;
-#endif
 
 	GLTexture_t *grTex = NULL;
 	float cliplow = 0.0f, cliphigh = 0.0f;
 	INT32 gr_midtexture;
 	fixed_t h, l; // 3D sides and 2s middle textures
-#ifdef ESLOPE
 	fixed_t hS, lS;
-#endif
 
 	FUINT lightnum = 0; // shut up compiler
 	extracolormap_t *colormap;
@@ -1371,13 +1300,10 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
 	ve.x = ((polyvertex_t *)gr_curline->pv2)->x;
 	ve.y = ((polyvertex_t *)gr_curline->pv2)->y;
 
-#ifdef ESLOPE
 	v1x = FLOAT_TO_FIXED(vs.x);
 	v1y = FLOAT_TO_FIXED(vs.y);
 	v2x = FLOAT_TO_FIXED(ve.x);
 	v2y = FLOAT_TO_FIXED(ve.y);
-#endif
-#ifdef ESLOPE
 
 #define SLOPEPARAMS(slope, end1, end2, normalheight) \
 	if (slope) { \
@@ -1388,10 +1314,6 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
 
 	SLOPEPARAMS(gr_frontsector->c_slope, worldtop,    worldtopslope,    gr_frontsector->ceilingheight)
 	SLOPEPARAMS(gr_frontsector->f_slope, worldbottom, worldbottomslope, gr_frontsector->floorheight)
-#else
-	worldtop    = gr_frontsector->ceilingheight;
-	worldbottom = gr_frontsector->floorheight;
-#endif
 
 	// remember vertices ordering
 	//  3--2
@@ -1441,14 +1363,9 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
 		boolean bothceilingssky = false; // turned on if both back and front ceilings are sky
 		boolean bothfloorssky = false; // likewise, but for floors
 
-#ifdef ESLOPE
 		SLOPEPARAMS(gr_backsector->c_slope, worldhigh, worldhighslope, gr_backsector->ceilingheight)
 		SLOPEPARAMS(gr_backsector->f_slope, worldlow,  worldlowslope,  gr_backsector->floorheight)
 #undef SLOPEPARAMS
-#else
-		worldhigh = gr_backsector->ceilingheight;
-		worldlow  = gr_backsector->floorheight;
-#endif
 
 		// hack to allow height changes in outdoor areas
 		// This is what gets rid of the upper textures if there should be sky
@@ -1471,12 +1388,7 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
 			gr_bottomtexture = R_GetTextureNum(gr_sidedef->bottomtexture);
 
 		// check TOP TEXTURE
-		if ((
-#ifdef ESLOPE
-			worldhighslope < worldtopslope ||
-#endif
-            worldhigh < worldtop
-            ) && gr_toptexture)
+		if ((worldhighslope < worldtopslope || worldhigh < worldtop) && gr_toptexture)
 		{
 			{
 				fixed_t texturevpegtop; // top
@@ -1486,15 +1398,10 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
 				// PEGGING
 				if (gr_linedef->flags & ML_DONTPEGTOP)
 					texturevpegtop = 0;
-#ifdef ESLOPE
 				else if (gr_linedef->flags & ML_EFFECT1)
 					texturevpegtop = worldhigh + textureheight[gr_sidedef->toptexture] - worldtop;
 				else
 					texturevpegtop = gr_backsector->ceilingheight + textureheight[gr_sidedef->toptexture] - gr_frontsector->ceilingheight;
-#else
-                else
-                    texturevpegtop = worldhigh + textureheight[gr_sidedef->toptexture] - worldtop;
-#endif
 
 				texturevpegtop += gr_sidedef->rowoffset;
 
@@ -1506,7 +1413,6 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
 				wallVerts[0].s = wallVerts[3].s = cliplow * grTex->scaleX;
 				wallVerts[2].s = wallVerts[1].s = cliphigh * grTex->scaleX;
 
-#ifdef ESLOPE
 				// Adjust t value for sloped walls
 				if (!(gr_linedef->flags & ML_EFFECT1))
 				{
@@ -1529,19 +1435,13 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
 					wallVerts[3].t = wallVerts[0].t - (worldtop - worldhigh) * grTex->scaleY;
 					wallVerts[2].t = wallVerts[1].t - (worldtopslope - worldhighslope) * grTex->scaleY;
 				}
-#endif
 			}
 
 			// set top/bottom coords
-#ifdef ESLOPE
 			wallVerts[3].y = FIXED_TO_FLOAT(worldtop);
 			wallVerts[0].y = FIXED_TO_FLOAT(worldhigh);
 			wallVerts[2].y = FIXED_TO_FLOAT(worldtopslope);
 			wallVerts[1].y = FIXED_TO_FLOAT(worldhighslope);
-#else
-			wallVerts[2].y = wallVerts[3].y = FIXED_TO_FLOAT(worldtop);
-			wallVerts[0].y = wallVerts[1].y = FIXED_TO_FLOAT(worldhigh);
-#endif
 
 			if (gr_frontsector->numlights)
 				HWR_SplitWall(gr_frontsector, wallVerts, gr_toptexture, &Surf, FF_CUTLEVEL, NULL);
@@ -1553,9 +1453,7 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
 
 		// check BOTTOM TEXTURE
 		if ((
-#ifdef ESLOPE
 			worldlowslope > worldbottomslope ||
-#endif
             worldlow > worldbottom) && gr_bottomtexture) //only if VISIBLE!!!
 		{
 			{
@@ -1564,19 +1462,12 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
 				grTex = HWR_GetTexture(gr_bottomtexture);
 
 				// PEGGING
-#ifdef ESLOPE
 				if (!(gr_linedef->flags & ML_DONTPEGBOTTOM))
 					texturevpegbottom = 0;
 				else if (gr_linedef->flags & ML_EFFECT1)
 					texturevpegbottom = worldbottom - worldlow;
 				else
 					texturevpegbottom = gr_frontsector->floorheight - gr_backsector->floorheight;
-#else
-				if (gr_linedef->flags & ML_DONTPEGBOTTOM)
-					texturevpegbottom = worldbottom - worldlow;
-                else
-                    texturevpegbottom = 0;
-#endif
 
 				texturevpegbottom += gr_sidedef->rowoffset;
 
@@ -1588,7 +1479,6 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
 				wallVerts[0].s = wallVerts[3].s = cliplow * grTex->scaleX;
 				wallVerts[2].s = wallVerts[1].s = cliphigh * grTex->scaleX;
 
-#ifdef ESLOPE
 				// Adjust t value for sloped walls
 				if (!(gr_linedef->flags & ML_EFFECT1))
 				{
@@ -1611,19 +1501,13 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
 					wallVerts[0].t = (texturevpegbottom + worldlow - worldbottom) * grTex->scaleY;
 					wallVerts[1].t = (texturevpegbottom + worldlowslope - worldbottomslope) * grTex->scaleY;
 				}
-#endif
 			}
 
 			// set top/bottom coords
-#ifdef ESLOPE
 			wallVerts[3].y = FIXED_TO_FLOAT(worldlow);
 			wallVerts[0].y = FIXED_TO_FLOAT(worldbottom);
 			wallVerts[2].y = FIXED_TO_FLOAT(worldlowslope);
 			wallVerts[1].y = FIXED_TO_FLOAT(worldbottomslope);
-#else
-			wallVerts[2].y = wallVerts[3].y = FIXED_TO_FLOAT(worldlow);
-			wallVerts[0].y = wallVerts[1].y = FIXED_TO_FLOAT(worldbottom);
-#endif
 
 			if (gr_frontsector->numlights)
 				HWR_SplitWall(gr_frontsector, wallVerts, gr_bottomtexture, &Surf, FF_CUTLEVEL, NULL);
@@ -1693,16 +1577,10 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
 			else
 #endif
             {
-#ifdef ESLOPE
 				popentop = min(worldtop, worldhigh);
 				popenbottom = max(worldbottom, worldlow);
-#else
-				popentop = min(front->ceilingheight, back->ceilingheight);
-				popenbottom = max(front->floorheight, back->floorheight);
-#endif
 			}
 
-#ifdef ESLOPE
 			if (gr_linedef->flags & ML_EFFECT2)
 			{
 				if (!!(gr_linedef->flags & ML_DONTPEGBOTTOM) ^ !!(gr_linedef->flags & ML_EFFECT3))
@@ -1717,9 +1595,6 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
 				}
 			}
 			else if (!!(gr_linedef->flags & ML_DONTPEGBOTTOM) ^ !!(gr_linedef->flags & ML_EFFECT3))
-#else
-            if (gr_linedef->flags & ML_DONTPEGBOTTOM)
-#endif
 			{
 				polybottom = popenbottom + gr_sidedef->rowoffset;
 				polytop = polybottom + textureheight[gr_midtexture]*repeats;
@@ -1751,11 +1626,7 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
 
 			{
 				// PEGGING
-#ifdef ESLOPE
 				if (!!(gr_linedef->flags & ML_DONTPEGBOTTOM) ^ !!(gr_linedef->flags & ML_EFFECT3))
-#else
-				if (gr_linedef->flags & ML_DONTPEGBOTTOM)
-#endif
 					texturevpeg = textureheight[gr_sidedef->midtexture]*repeats - h + polybottom;
 				else
 					texturevpeg = polytop - h;
@@ -1774,7 +1645,6 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
 			wallVerts[2].y = wallVerts[3].y = FIXED_TO_FLOAT(h);
 			wallVerts[0].y = wallVerts[1].y = FIXED_TO_FLOAT(l);
 
-#ifdef ESLOPE
 			// Correct to account for slopes
 			{
 				fixed_t midtextureslant;
@@ -1817,7 +1687,6 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
 				wallVerts[2].y = FIXED_TO_FLOAT(h);
 				wallVerts[1].y = FIXED_TO_FLOAT(l);
 			}
-#endif
 
 			// set alpha for transparent walls
 			// ooops ! this do not work at all because render order we should render it in backtofront order
@@ -1895,12 +1764,8 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
 				if (gr_backsector->ceilingpic != skyflatnum) // don't cull if back sector is also sky
 				{
 					wallVerts[2].y = wallVerts[3].y = FIXED_TO_FLOAT(INT32_MAX); // draw to top of map space
-#ifdef ESLOPE
 					wallVerts[0].y = FIXED_TO_FLOAT(worldtop);
 					wallVerts[1].y = FIXED_TO_FLOAT(worldtopslope);
-#else
-					wallVerts[0].y = wallVerts[1].y = FIXED_TO_FLOAT(worldtop);
-#endif
 					HWR_DrawSkyWall(wallVerts, &Surf);
 				}
 			}
@@ -1909,12 +1774,8 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
 			{
 				if (gr_backsector->floorpic != skyflatnum) // don't cull if back sector is also sky
 				{
-#ifdef ESLOPE
 					wallVerts[3].y = FIXED_TO_FLOAT(worldbottom);
 					wallVerts[2].y = FIXED_TO_FLOAT(worldbottomslope);
-#else
-					wallVerts[2].y = wallVerts[3].y = FIXED_TO_FLOAT(worldbottom);
-#endif
 					wallVerts[0].y = wallVerts[1].y = FIXED_TO_FLOAT(INT32_MIN); // draw to bottom of map space
 					HWR_DrawSkyWall(wallVerts, &Surf);
 				}
@@ -1931,12 +1792,9 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
 			{
 				fixed_t     texturevpeg;
 				// PEGGING
-#ifdef ESLOPE
 				if ((gr_linedef->flags & (ML_DONTPEGBOTTOM|ML_EFFECT2)) == (ML_DONTPEGBOTTOM|ML_EFFECT2))
 					texturevpeg = gr_frontsector->floorheight + textureheight[gr_sidedef->midtexture] - gr_frontsector->ceilingheight + gr_sidedef->rowoffset;
-				else
-#endif
-				if (gr_linedef->flags & ML_DONTPEGBOTTOM)
+				else if (gr_linedef->flags & ML_DONTPEGBOTTOM)
 					texturevpeg = worldbottom + textureheight[gr_sidedef->midtexture] - worldtop + gr_sidedef->rowoffset;
 				else
 					// top of texture at top
@@ -1949,7 +1807,6 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
 				wallVerts[0].s = wallVerts[3].s = cliplow * grTex->scaleX;
 				wallVerts[2].s = wallVerts[1].s = cliphigh * grTex->scaleX;
 
-#ifdef ESLOPE
 				// Texture correction for slopes
 				if (gr_linedef->flags & ML_EFFECT2) {
 					wallVerts[3].t += (gr_frontsector->ceilingheight - worldtop) * grTex->scaleY;
@@ -1963,19 +1820,14 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
 					wallVerts[0].t = wallVerts[3].t - (worldbottom-worldtop) * grTex->scaleY;
 					wallVerts[1].t = wallVerts[2].t - (worldbottomslope-worldtopslope) * grTex->scaleY;
 				}
-#endif
 			}
-#ifdef ESLOPE
+
 			//Set textures properly on single sided walls that are sloped
 			wallVerts[3].y = FIXED_TO_FLOAT(worldtop);
 			wallVerts[0].y = FIXED_TO_FLOAT(worldbottom);
 			wallVerts[2].y = FIXED_TO_FLOAT(worldtopslope);
 			wallVerts[1].y = FIXED_TO_FLOAT(worldbottomslope);
-#else
-			// set top/bottom coords
-			wallVerts[2].y = wallVerts[3].y = FIXED_TO_FLOAT(worldtop);
-			wallVerts[0].y = wallVerts[1].y = FIXED_TO_FLOAT(worldbottom);
-#endif
+
 			// I don't think that solid walls can use translucent linedef types...
 			if (gr_frontsector->numlights)
 				HWR_SplitWall(gr_frontsector, wallVerts, gr_midtexture, &Surf, FF_CUTLEVEL, NULL);
@@ -1993,22 +1845,14 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
 			if (gr_frontsector->ceilingpic == skyflatnum) // It's a single-sided line with sky for its sector
 			{
 				wallVerts[2].y = wallVerts[3].y = FIXED_TO_FLOAT(INT32_MAX); // draw to top of map space
-#ifdef ESLOPE
 				wallVerts[0].y = FIXED_TO_FLOAT(worldtop);
 				wallVerts[1].y = FIXED_TO_FLOAT(worldtopslope);
-#else
-				wallVerts[0].y = wallVerts[1].y = FIXED_TO_FLOAT(worldtop);
-#endif
 				HWR_DrawSkyWall(wallVerts, &Surf);
 			}
 			if (gr_frontsector->floorpic == skyflatnum)
 			{
-#ifdef ESLOPE
 				wallVerts[3].y = FIXED_TO_FLOAT(worldbottom);
 				wallVerts[2].y = FIXED_TO_FLOAT(worldbottomslope);
-#else
-				wallVerts[2].y = wallVerts[3].y = FIXED_TO_FLOAT(worldbottom);
-#endif
 				wallVerts[0].y = wallVerts[1].y = FIXED_TO_FLOAT(INT32_MIN); // draw to bottom of map space
 				HWR_DrawSkyWall(wallVerts, &Surf);
 			}
@@ -2049,7 +1893,6 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
 					texnum = R_GetTextureNum(sides[newline->sidenum[0]].midtexture);
 				}
 
-#ifdef ESLOPE
 				h  = *rover->t_slope ? P_GetZAt(*rover->t_slope, v1x, v1y) : *rover->topheight;
 				hS = *rover->t_slope ? P_GetZAt(*rover->t_slope, v2x, v2y) : *rover->topheight;
 				l  = *rover->b_slope ? P_GetZAt(*rover->b_slope, v1x, v1y) : *rover->bottomheight;
@@ -2066,19 +1909,6 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
 				wallVerts[2].y = FIXED_TO_FLOAT(hS);
 				wallVerts[0].y = FIXED_TO_FLOAT(l);
 				wallVerts[1].y = FIXED_TO_FLOAT(lS);
-#else
-				h = *rover->topheight;
-				l = *rover->bottomheight;
-				if (h > highcut)
-					h = highcut;
-				if (l < lowcut)
-					l = lowcut;
-				//Hurdler: HW code starts here
-				//FIXME: check if peging is correct
-				// set top/bottom coords
-				wallVerts[2].y = wallVerts[3].y = FIXED_TO_FLOAT(h);
-				wallVerts[0].y = wallVerts[1].y = FIXED_TO_FLOAT(l);
-#endif
 				if (rover->flags & FF_FOG)
 				{
 					wallVerts[3].t = wallVerts[2].t = 0;
@@ -2090,9 +1920,7 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
 				{
 					fixed_t texturevpeg;
 					boolean attachtobottom = false;
-#ifdef ESLOPE
 					boolean slopeskew = false; // skew FOF walls with slopes?
-#endif
 
 					// Wow, how was this missing from OpenGL for so long?
 					// ...Oh well, anyway, Lower Unpegged now changes pegging of FOFs like in software
@@ -2101,22 +1929,17 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
 					{
 						texturevpeg = sides[newline->sidenum[0]].rowoffset;
 						attachtobottom = !!(newline->flags & ML_DONTPEGBOTTOM);
-#ifdef ESLOPE
 						slopeskew = !!(newline->flags & ML_DONTPEGTOP);
-#endif
 					}
 					else
 					{
 						texturevpeg = sides[rover->master->sidenum[0]].rowoffset;
 						attachtobottom = !!(gr_linedef->flags & ML_DONTPEGBOTTOM);
-#ifdef ESLOPE
 						slopeskew = !!(rover->master->flags & ML_DONTPEGTOP);
-#endif
 					}
 
 					grTex = HWR_GetTexture(texnum);
 
-#ifdef ESLOPE
 					if (!slopeskew) // no skewing
 					{
 						if (attachtobottom)
@@ -2141,12 +1964,6 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
 							wallVerts[2].t = wallVerts[1].t - (hS - lS) * grTex->scaleY;
 						}
 					}
-#else
-					if (attachtobottom)
-						texturevpeg -= *rover->topheight - *rover->bottomheight;
-					wallVerts[3].t = wallVerts[2].t = (*rover->topheight - h + texturevpeg) * grTex->scaleY;
-					wallVerts[0].t = wallVerts[1].t = (*rover->topheight - l + texturevpeg) * grTex->scaleY;
-#endif
 
 					wallVerts[0].s = wallVerts[3].s = cliplow * grTex->scaleX;
 					wallVerts[2].s = wallVerts[1].s = cliphigh * grTex->scaleX;
@@ -2215,7 +2032,6 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
 					newline = rover->master->frontsector->lines[0] + linenum;
 					texnum = R_GetTextureNum(sides[newline->sidenum[0]].midtexture);
 				}
-#ifdef ESLOPE //backsides
 				h  = *rover->t_slope ? P_GetZAt(*rover->t_slope, v1x, v1y) : *rover->topheight;
 				hS = *rover->t_slope ? P_GetZAt(*rover->t_slope, v2x, v2y) : *rover->topheight;
 				l  = *rover->b_slope ? P_GetZAt(*rover->b_slope, v1x, v1y) : *rover->bottomheight;
@@ -2232,19 +2048,6 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
 				wallVerts[2].y = FIXED_TO_FLOAT(hS);
 				wallVerts[0].y = FIXED_TO_FLOAT(l);
 				wallVerts[1].y = FIXED_TO_FLOAT(lS);
-#else
-				h = *rover->topheight;
-				l = *rover->bottomheight;
-				if (h > highcut)
-					h = highcut;
-				if (l < lowcut)
-					l = lowcut;
-				//Hurdler: HW code starts here
-				//FIXME: check if peging is correct
-				// set top/bottom coords
-				wallVerts[2].y = wallVerts[3].y = FIXED_TO_FLOAT(h);
-				wallVerts[0].y = wallVerts[1].y = FIXED_TO_FLOAT(l);
-#endif
 				if (rover->flags & FF_FOG)
 				{
 					wallVerts[3].t = wallVerts[2].t = 0;
@@ -2342,7 +2145,6 @@ static boolean CheckClip(seg_t * seg, sector_t * afrontsector, sector_t * abacks
 
 	// GZDoom method of sloped line clipping
 
-#ifdef ESLOPE
 	if (afrontsector->f_slope || afrontsector->c_slope || abacksector->f_slope || abacksector->c_slope)
 	{
 		fixed_t v1x, v1y, v2x, v2y; // the seg's vertexes as fixed_t
@@ -2364,7 +2166,6 @@ static boolean CheckClip(seg_t * seg, sector_t * afrontsector, sector_t * abacks
 #undef SLOPEPARAMS
 	}
 	else
-#endif
 	{
 		frontf1 = frontf2 = afrontsector->floorheight;
 		frontc1 = frontc2 = afrontsector->ceilingheight;
@@ -2905,7 +2706,6 @@ static void HWR_AddLine(seg_t * line)
 		goto clippass; // treat like wide open window instead
 	}
 
-#ifdef ESLOPE
 	if (gr_frontsector->f_slope || gr_frontsector->c_slope || gr_backsector->f_slope || gr_backsector->c_slope)
 	{
 		fixed_t frontf1,frontf2, frontc1, frontc2; // front floor/ceiling ends
@@ -2950,7 +2750,6 @@ static void HWR_AddLine(seg_t * line)
 				goto clippass;
 	}
 	else
-#endif
 	{
 		// if both ceilings are skies, consider it always "open"
 		// same for floors
@@ -3488,7 +3287,6 @@ static void HWR_Subsector(size_t num)
 		cullFloorHeight   = locFloorHeight   = gr_frontsector->floorheight;
 		cullCeilingHeight = locCeilingHeight = gr_frontsector->ceilingheight;
 
-#ifdef ESLOPE
 		if (gr_frontsector->f_slope)
 		{
 			cullFloorHeight = P_GetZAt(gr_frontsector->f_slope, viewx, viewy);
@@ -3500,7 +3298,6 @@ static void HWR_Subsector(size_t num)
 			cullCeilingHeight = P_GetZAt(gr_frontsector->c_slope, viewx, viewy);
 			locCeilingHeight = P_GetZAt(gr_frontsector->c_slope, gr_frontsector->soundorg.x, gr_frontsector->soundorg.y);
 		}
-#endif
 	}
 // ----- end special tricks -----
 
@@ -3592,15 +3389,13 @@ static void HWR_Subsector(size_t num)
 			fixed_t cullHeight, centerHeight;
 
             // bottom plane
-#ifdef ESLOPE
 			if (*rover->b_slope)
 			{
 				cullHeight = P_GetZAt(*rover->b_slope, viewx, viewy);
 				centerHeight = P_GetZAt(*rover->b_slope, gr_frontsector->soundorg.x, gr_frontsector->soundorg.y);
 			}
 			else
-#endif
-		    cullHeight = centerHeight = *rover->bottomheight;
+				cullHeight = centerHeight = *rover->bottomheight;
 
 			if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_RENDERPLANES))
 				continue;
@@ -3660,15 +3455,13 @@ static void HWR_Subsector(size_t num)
 			}
 
 			// top plane
-#ifdef ESLOPE
 			if (*rover->t_slope)
 			{
 				cullHeight = P_GetZAt(*rover->t_slope, viewx, viewy);
 				centerHeight = P_GetZAt(*rover->t_slope, gr_frontsector->soundorg.x, gr_frontsector->soundorg.y);
 			}
 			else
-#endif
-		    cullHeight = centerHeight = *rover->topheight;
+				cullHeight = centerHeight = *rover->topheight;
 
 			if (centerHeight >= locFloorHeight &&
 			    centerHeight <= locCeilingHeight &&
@@ -4240,13 +4033,11 @@ static void HWR_SplitSprite(gr_vissprite_t *spr)
 	float realheight, heightmult;
 	const sector_t *sector = spr->mobj->subsector->sector;
 	const lightlist_t *list = sector->lightlist;
-#ifdef ESLOPE
 	float endrealtop, endrealbot, endtop, endbot;
 	float endbheight;
 	float endrealheight;
 	fixed_t temp;
 	fixed_t v1x, v1y, v2x, v2y;
-#endif
 
 	this_scale = FIXED_TO_FLOAT(spr->mobj->scale);
 
@@ -4318,10 +4109,8 @@ static void HWR_SplitSprite(gr_vissprite_t *spr)
 	towbot = baseWallVerts[0].tow;
 	towmult = (towbot - towtop) / (top - bot);
 
-#ifdef ESLOPE
 	endrealtop = endtop = baseWallVerts[2].y;
 	endrealbot = endbot = baseWallVerts[1].y;
-#endif
 
 	// copy the contents of baseWallVerts into the drawn wallVerts array
 	// baseWallVerts is used to know the final shape to easily get the vertex
@@ -4361,7 +4150,6 @@ static void HWR_SplitSprite(gr_vissprite_t *spr)
 	if (spr->mobj->frame & FF_FULLBRIGHT)
 		lightlevel = 255;
 
-#ifdef ESLOPE
 	for (i = 1; i < sector->numlights; i++)
 	{
 		fixed_t h = sector->lightlist[i].slope ? P_GetZAt(sector->lightlist[i].slope, spr->mobj->x, spr->mobj->y)
@@ -4374,19 +4162,10 @@ static void HWR_SplitSprite(gr_vissprite_t *spr)
 			break;
 		}
 	}
-#else
-	i = R_GetPlaneLight(sector, temp, false);
-	if (!(spr->mobj->frame & FF_FULLBRIGHT))
-		lightlevel = *list[i].lightlevel;
-	colormap = *list[i].extra_colormap;
-#endif
 
 	for (i = 0; i < sector->numlights; i++)
 	{
-#ifdef ESLOPE
-		if (endtop < endrealbot)
-#endif
-		if (top < realbot)
+		if (endtop < endrealbot && top < realbot)
 			return;
 
 		// even if we aren't changing colormap or lightlevel, we still need to continue drawing down the sprite
@@ -4397,7 +4176,6 @@ static void HWR_SplitSprite(gr_vissprite_t *spr)
 			colormap = *list[i].extra_colormap;
 		}
 
-#ifdef ESLOPE
 		if (i + 1 < sector->numlights)
 		{
 			if (list[i+1].slope)
@@ -4415,21 +4193,8 @@ static void HWR_SplitSprite(gr_vissprite_t *spr)
 			bheight = realbot;
 			endbheight = endrealbot;
 		}
-#else
-		if (i + 1 < sector->numlights)
-		{
-			bheight = FIXED_TO_FLOAT(list[i+1].height);
-		}
-		else
-		{
-			bheight = realbot;
-		}
-#endif
 
-#ifdef ESLOPE
-		if (endbheight >= endtop)
-#endif
-		if (bheight >= top)
+		if (endbheight >= endtop && bheight >= top)
 			continue;
 
 		bot = bheight;
@@ -4437,14 +4202,11 @@ static void HWR_SplitSprite(gr_vissprite_t *spr)
 		if (bot < realbot)
 			bot = realbot;
 
-#ifdef ESLOPE
 		endbot = endbheight;
 
 		if (endbot < endrealbot)
 			endbot = endrealbot;
-#endif
 
-#ifdef ESLOPE
 		wallVerts[3].tow = towtop + ((realtop - top) * towmult);
 		wallVerts[2].tow = towtop + ((endrealtop - endtop) * towmult);
 		wallVerts[0].tow = towtop + ((realtop - bot) * towmult);
@@ -4478,32 +4240,6 @@ static void HWR_SplitSprite(gr_vissprite_t *spr)
 			wallVerts[1].x = baseWallVerts[2].x + (baseWallVerts[2].x - baseWallVerts[1].x) * heightmult;
 			wallVerts[1].z = baseWallVerts[2].z + (baseWallVerts[2].z - baseWallVerts[1].z) * heightmult;
 		}
-#else
-		wallVerts[3].tow = wallVerts[2].tow = towtop + ((realtop - top) * towmult);
-		wallVerts[0].tow = wallVerts[1].tow = towtop + ((realtop - bot) * towmult);
-
-		wallVerts[2].y = wallVerts[3].y = top;
-		wallVerts[0].y = wallVerts[1].y = bot;
-
-		// The x and y only need to be adjusted in the case that it's not a papersprite
-		if (cv_grspritebillboarding.value
-			&& spr->mobj && !(spr->mobj->frame & FF_PAPERSPRITE))
-		{
-			// Get the x and z of the vertices so billboarding draws correctly
-			realheight = realbot - realtop;
-			heightmult = (realtop - top) / realheight;
-			wallVerts[3].x = baseWallVerts[3].x + (baseWallVerts[3].x - baseWallVerts[0].x) * heightmult;
-			wallVerts[3].z = baseWallVerts[3].z + (baseWallVerts[3].z - baseWallVerts[0].z) * heightmult;
-			wallVerts[2].x = baseWallVerts[2].x + (baseWallVerts[2].x - baseWallVerts[1].x) * heightmult;
-			wallVerts[2].z = baseWallVerts[2].z + (baseWallVerts[2].z - baseWallVerts[1].z) * heightmult;
-
-			heightmult = (realtop - bot) / realheight;
-			wallVerts[0].x = baseWallVerts[3].x + (baseWallVerts[3].x - baseWallVerts[0].x) * heightmult;
-			wallVerts[0].z = baseWallVerts[3].z + (baseWallVerts[3].z - baseWallVerts[0].z) * heightmult;
-			wallVerts[1].x = baseWallVerts[2].x + (baseWallVerts[2].x - baseWallVerts[1].x) * heightmult;
-			wallVerts[1].z = baseWallVerts[2].z + (baseWallVerts[2].z - baseWallVerts[1].z) * heightmult;
-		}
-#endif
 
 		if (colormap)
 			Surf.FlatColor.rgba = HWR_Lighting(lightlevel, colormap->rgba, colormap->fadergba, false, false);
@@ -4515,21 +4251,15 @@ static void HWR_SplitSprite(gr_vissprite_t *spr)
 		HWD.pfnDrawPolygon(&Surf, wallVerts, 4, blend|PF_Modulated|PF_Clip);
 
 		top = bot;
-#ifdef ESLOPE
 		endtop = endbot;
-#endif
 	}
 
 	bot = realbot;
-#ifdef ESLOPE
 	endbot = endrealbot;
-	if (endtop <= endrealbot)
-#endif
-	if (top <= realbot)
+	if (endtop <= endrealbot && top <= realbot)
 		return;
 
 	// If we're ever down here, somehow the above loop hasn't draw all the light levels of sprite
-#ifdef ESLOPE
 	wallVerts[3].tow = towtop + ((realtop - top) * towmult);
 	wallVerts[2].tow = towtop + ((endrealtop - endtop) * towmult);
 	wallVerts[0].tow = towtop + ((realtop - bot) * towmult);
@@ -4539,13 +4269,6 @@ static void HWR_SplitSprite(gr_vissprite_t *spr)
 	wallVerts[2].y = endtop;
 	wallVerts[0].y = bot;
 	wallVerts[1].y = endbot;
-#else
-	wallVerts[3].tow = wallVerts[2].tow = towtop + ((realtop - top) * towmult);
-	wallVerts[0].tow = wallVerts[1].tow = towtop + ((realtop - bot) * towmult);
-
-	wallVerts[2].y = wallVerts[3].y = top;
-	wallVerts[0].y = wallVerts[1].y = bot;
-#endif
 
 	if (colormap)
 		Surf.FlatColor.rgba = HWR_Lighting(lightlevel, colormap->rgba, colormap->fadergba, false, false);
diff --git a/src/hardware/hw_trick.c b/src/hardware/hw_trick.c
index 97d86b944890de2fae05d11bfd05ed607722b3d3..82d81b5b2520925835ed635faf392a0469239fb5 100644
--- a/src/hardware/hw_trick.c
+++ b/src/hardware/hw_trick.c
@@ -610,10 +610,8 @@ static boolean isCeilingFloating(sector_t *thisSector)
 		if (!adjSector) // assume floating sectors have surrounding sectors
 			return false;
 
-#ifdef ESLOPE
 		if (adjSector->c_slope) // Don't bother with slopes
 			return false;
-#endif
 
 		if (!refSector)
 		{
@@ -663,10 +661,8 @@ static boolean isFloorFloating(sector_t *thisSector)
 		if (!adjSector) // assume floating sectors have surrounding sectors
 			return false;
 
-#ifdef ESLOPE
 		if (adjSector->f_slope) // Don't bother with slopes
 			return false;
-#endif
 
 		if (!refSector)
 		{
diff --git a/src/hu_stuff.c b/src/hu_stuff.c
index 98f3ca5a990fad5aed7367f9842f61b04372255e..6aa5a451000a429ab351065c3c97b2d9a7fb72f4 100644
--- a/src/hu_stuff.c
+++ b/src/hu_stuff.c
@@ -47,10 +47,8 @@
 #include "hardware/hw_main.h"
 #endif
 
-#ifdef HAVE_BLUA
 #include "lua_hud.h"
 #include "lua_hook.h"
-#endif
 
 // coords are scaled
 #define HU_INPUTX 0
@@ -688,10 +686,8 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
 
 	// run the lua hook even if we were supposed to eat the msg, netgame consistency goes first.
 
-#ifdef HAVE_BLUA
 	if (LUAh_PlayerMsg(playernum, target, flags, msg))
 		return;
-#endif
 
 	if (spam_eatmsg)
 		return; // don't proceed if we were supposed to eat the message.
@@ -2177,18 +2173,14 @@ void HU_Drawer(void)
 	{
 		if (netgame || multiplayer)
 		{
-#ifdef HAVE_BLUA
 			if (LUA_HudEnabled(hud_rankings))
-#endif
-			HU_DrawRankings();
+				HU_DrawRankings();
 			if (gametype == GT_COOP)
 				HU_DrawNetplayCoopOverlay();
 		}
 		else
 			HU_DrawCoopOverlay();
-#ifdef HAVE_BLUA
 		LUAh_ScoresHUD();
-#endif
 	}
 
 	if (gamestate != GS_LEVEL)
@@ -3171,29 +3163,20 @@ static void HU_DrawRankings(void)
 
 static void HU_DrawCoopOverlay(void)
 {
-	if (token
-#ifdef HAVE_BLUA
-	&& LUA_HudEnabled(hud_tokens)
-#endif
-	)
+	if (token && LUA_HudEnabled(hud_tokens))
 	{
 		V_DrawString(168, 176, 0, va("- %d", token));
 		V_DrawSmallScaledPatch(148, 172, 0, tokenicon);
 	}
 
-#ifdef HAVE_BLUA
-	if (LUA_HudEnabled(hud_tabemblems))
-#endif
-	if (!modifiedgame || savemoddata)
+	if (LUA_HudEnabled(hud_tabemblems) && (!modifiedgame || savemoddata))
 	{
 		V_DrawString(160, 144, 0, va("- %d/%d", M_CountEmblems(), numemblems+numextraemblems));
 		V_DrawScaledPatch(128, 144 - SHORT(emblemicon->height)/4, 0, emblemicon);
 	}
 
-#ifdef HAVE_BLUA
 	if (!LUA_HudEnabled(hud_coopemeralds))
 		return;
-#endif
 
 	if (emeralds & EMERALD1)
 		V_DrawScaledPatch((BASEVIDWIDTH/2)-8   , (BASEVIDHEIGHT/3)-32, 0, emeraldpics[0][0]);
@@ -3215,20 +3198,14 @@ static void HU_DrawNetplayCoopOverlay(void)
 {
 	int i;
 
-	if (token
-#ifdef HAVE_BLUA
-	&& LUA_HudEnabled(hud_tokens)
-#endif
-	)
+	if (token && LUA_HudEnabled(hud_tokens))
 	{
 		V_DrawString(168, 10, 0, va("- %d", token));
 		V_DrawSmallScaledPatch(148, 6, 0, tokenicon);
 	}
 
-#ifdef HAVE_BLUA
 	if (!LUA_HudEnabled(hud_coopemeralds))
 		return;
-#endif
 
 	for (i = 0; i < 7; ++i)
 	{
diff --git a/src/lua_baselib.c b/src/lua_baselib.c
index 35b94fc6fb2995a5ccd48a942c72d1e07e2bcd94..7a99d1b0b884b0087491136170cda2142b4bbe98 100644
--- a/src/lua_baselib.c
+++ b/src/lua_baselib.c
@@ -11,17 +11,14 @@
 /// \brief basic functions for Lua scripting
 
 #include "doomdef.h"
-#ifdef HAVE_BLUA
 #include "fastcmp.h"
 #include "p_local.h"
 #include "p_setup.h" // So we can have P_SetupLevelSky
-#ifdef ESLOPE
 #include "p_slopes.h" // P_GetZAt
-#endif
 #include "z_zone.h"
 #include "r_main.h"
 #include "r_draw.h"
-#include "r_things.h"
+#include "r_things.h" // R_Frame2Char etc
 #include "m_random.h"
 #include "s_sound.h"
 #include "g_game.h"
@@ -1042,11 +1039,60 @@ static int lib_pSetObjectMomZ(lua_State *L)
 	return 0;
 }
 
+static int lib_pPlayJingle(lua_State *L)
+{
+	player_t *player = NULL;
+	jingletype_t jingletype = luaL_checkinteger(L, 2);
+	//NOHUD
+	//INLEVEL
+	if (!lua_isnone(L, 1) && lua_isuserdata(L, 1))
+	{
+		player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
+		if (!player)
+			return LUA_ErrInvalid(L, "player_t");
+	}
+	if (jingletype >= NUMJINGLES)
+		return luaL_error(L, "jingletype %d out of range (0 - %d)", jingletype, NUMJINGLES-1);
+	P_PlayJingle(player, jingletype);
+	return 0;
+}
+
+static int lib_pPlayJingleMusic(lua_State *L)
+{
+	player_t *player = NULL;
+	const char *musnamearg = luaL_checkstring(L, 2);
+	char musname[7], *p = musname;
+	UINT16 musflags = luaL_optinteger(L, 3, 0);
+	boolean looping = lua_opttrueboolean(L, 4);
+	jingletype_t jingletype = luaL_optinteger(L, 5, JT_OTHER);
+	//NOHUD
+	//INLEVEL
+	if (!lua_isnone(L, 1) && lua_isuserdata(L, 1))
+	{
+		player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
+		if (!player)
+			return LUA_ErrInvalid(L, "player_t");
+	}
+	if (jingletype >= NUMJINGLES)
+		return luaL_error(L, "jingletype %d out of range (0 - %d)", jingletype, NUMJINGLES-1);
+
+	musname[6] = '\0';
+	strncpy(musname, musnamearg, 6);
+
+	while (*p) {
+		*p = tolower(*p);
+		++p;
+	}
+
+	P_PlayJingleMusic(player, musname, musflags, looping, jingletype);
+	return 0;
+}
+
 static int lib_pRestoreMusic(lua_State *L)
 {
 	player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
-	NOHUD
-	INLEVEL
+	//NOHUD
+	//INLEVEL
 	if (!player)
 		return LUA_ErrInvalid(L, "player_t");
 	if (P_IsLocalPlayer(player))
@@ -1676,11 +1722,15 @@ static int lib_pPlayVictorySound(lua_State *L)
 
 static int lib_pPlayLivesJingle(lua_State *L)
 {
-	player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
-	NOHUD
-	INLEVEL
-	if (!player)
-		return LUA_ErrInvalid(L, "player_t");
+	player_t *player = NULL;
+	//NOHUD
+	//INLEVEL
+	if (!lua_isnone(L, 1) && lua_isuserdata(L, 1))
+	{
+		player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
+		if (!player)
+			return LUA_ErrInvalid(L, "player_t");
+	}
 	P_PlayLivesJingle(player);
 	return 0;
 }
@@ -2125,7 +2175,6 @@ static int lib_evStartCrumble(lua_State *L)
 	return 0;
 }
 
-#ifdef ESLOPE
 // P_SLOPES
 ////////////
 
@@ -2141,7 +2190,6 @@ static int lib_pGetZAt(lua_State *L)
 	lua_pushfixed(L, P_GetZAt(slope, x, y));
 	return 1;
 }
-#endif
 
 // R_DEFS
 ////////////
@@ -2344,7 +2392,7 @@ static int lib_sStartSound(lua_State *L)
 	const void *origin = NULL;
 	sfxenum_t sound_id = luaL_checkinteger(L, 2);
 	player_t *player = NULL;
-	//NOHUD // kys @whoever did this.
+	//NOHUD
 	if (sound_id >= NUMSFX)
 		return luaL_error(L, "sfx %d out of range (0 - %d)", sound_id, NUMSFX-1);
 	if (!lua_isnil(L, 1))
@@ -2375,7 +2423,7 @@ static int lib_sStartSoundAtVolume(lua_State *L)
 	sfxenum_t sound_id = luaL_checkinteger(L, 2);
 	INT32 volume = (INT32)luaL_checkinteger(L, 3);
 	player_t *player = NULL;
-	NOHUD
+	//NOHUD
 
 	if (!lua_isnil(L, 1))
 	{
@@ -2399,7 +2447,7 @@ static int lib_sStartSoundAtVolume(lua_State *L)
 static int lib_sStopSound(lua_State *L)
 {
 	void *origin = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
-	NOHUD
+	//NOHUD
 	if (!origin)
 		return LUA_ErrInvalid(L, "mobj_t");
 	S_StopSound(origin);
@@ -2416,7 +2464,7 @@ static int lib_sChangeMusic(lua_State *L)
 	boolean looping;
 	player_t *player = NULL;
 	UINT16 music_flags = 0;
-	NOHUD
+	//NOHUD
 
 	if (lua_isnumber(L, 1))
 	{
@@ -2445,7 +2493,7 @@ static int lib_sChangeMusic(lua_State *L)
 	boolean looping = (boolean)lua_opttrueboolean(L, 2);
 	player_t *player = NULL;
 	UINT16 music_flags = 0;
-	NOHUD
+	//NOHUD
 
 #endif
 	if (!lua_isnone(L, 3) && lua_isuserdata(L, 3))
@@ -2476,7 +2524,7 @@ static int lib_sSpeedMusic(lua_State *L)
 	fixed_t fixedspeed = luaL_checkfixed(L, 1);
 	float speed = FIXED_TO_FLOAT(fixedspeed);
 	player_t *player = NULL;
-	NOHUD
+	//NOHUD
 	if (!lua_isnone(L, 2) && lua_isuserdata(L, 2))
 	{
 		player = *((player_t **)luaL_checkudata(L, 2, META_PLAYER));
@@ -2491,7 +2539,7 @@ static int lib_sSpeedMusic(lua_State *L)
 static int lib_sStopMusic(lua_State *L)
 {
 	player_t *player = NULL;
-	NOHUD
+	//NOHUD
 	if (!lua_isnone(L, 1) && lua_isuserdata(L, 1))
 	{
 		player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
@@ -2507,7 +2555,7 @@ static int lib_sSetInternalMusicVolume(lua_State *L)
 {
 	UINT32 volume = (UINT32)luaL_checkinteger(L, 1);
 	player_t *player = NULL;
-	NOHUD
+	//NOHUD
 	if (!lua_isnone(L, 2) && lua_isuserdata(L, 2))
 	{
 		player = *((player_t **)luaL_checkudata(L, 2, META_PLAYER));
@@ -2527,7 +2575,7 @@ static int lib_sSetInternalMusicVolume(lua_State *L)
 static int lib_sStopFadingMusic(lua_State *L)
 {
 	player_t *player = NULL;
-	NOHUD
+	//NOHUD
 	if (!lua_isnone(L, 1) && lua_isuserdata(L, 1))
 	{
 		player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
@@ -2550,7 +2598,7 @@ static int lib_sFadeMusic(lua_State *L)
 	UINT32 ms;
 	INT32 source_volume;
 	player_t *player = NULL;
-	NOHUD
+	//NOHUD
 	if (!lua_isnone(L, 3) && lua_isuserdata(L, 3))
 	{
 		player = *((player_t **)luaL_checkudata(L, 3, META_PLAYER));
@@ -2578,8 +2626,6 @@ static int lib_sFadeMusic(lua_State *L)
 		ms = (UINT32)luaL_checkinteger(L, 3);
 	}
 
-	NOHUD
-
 	if (!player || P_IsLocalPlayer(player))
 		lua_pushboolean(L, S_FadeMusicFromVolume(target_volume, source_volume, ms));
 	else
@@ -2591,7 +2637,7 @@ static int lib_sFadeOutStopMusic(lua_State *L)
 {
 	UINT32 ms = (UINT32)luaL_checkinteger(L, 1);
 	player_t *player = NULL;
-	NOHUD
+	//NOHUD
 	if (!lua_isnone(L, 2) && lua_isuserdata(L, 2))
 	{
 		player = *((player_t **)luaL_checkudata(L, 2, META_PLAYER));
@@ -2607,10 +2653,29 @@ static int lib_sFadeOutStopMusic(lua_State *L)
 	return 1;
 }
 
+static int lib_sGetMusicLength(lua_State *L)
+{
+	lua_pushinteger(L, S_GetMusicLength());
+	return 1;
+}
+
+static int lib_sGetMusicPosition(lua_State *L)
+{
+	lua_pushinteger(L, S_GetMusicPosition());
+	return 1;
+}
+
+static int lib_sSetMusicPosition(lua_State *L)
+{
+	UINT32 pos = (UINT32)luaL_checkinteger(L, 1);
+	lua_pushboolean(L, S_SetMusicPosition(pos));
+	return 1;
+}
+
 static int lib_sOriginPlaying(lua_State *L)
 {
 	void *origin = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
-	NOHUD
+	//NOHUD
 	INLEVEL
 	if (!origin)
 		return LUA_ErrInvalid(L, "mobj_t");
@@ -2621,7 +2686,7 @@ static int lib_sOriginPlaying(lua_State *L)
 static int lib_sIdPlaying(lua_State *L)
 {
 	sfxenum_t id = luaL_checkinteger(L, 1);
-	NOHUD
+	//NOHUD
 	if (id >= NUMSFX)
 		return luaL_error(L, "sfx %d out of range (0 - %d)", id, NUMSFX-1);
 	lua_pushboolean(L, S_IdPlaying(id));
@@ -2632,7 +2697,7 @@ static int lib_sSoundPlaying(lua_State *L)
 {
 	void *origin = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
 	sfxenum_t id = luaL_checkinteger(L, 2);
-	NOHUD
+	//NOHUD
 	INLEVEL
 	if (!origin)
 		return LUA_ErrInvalid(L, "mobj_t");
@@ -2650,7 +2715,7 @@ static int lib_sStartMusicCaption(lua_State *L)
 	const char *caption = luaL_checkstring(L, 1);
 	UINT16 lifespan = (UINT16)luaL_checkinteger(L, 2);
 	//HUDSAFE
-	INLEVEL
+	//INLEVEL
 
 	if (!lua_isnone(L, 3) && lua_isuserdata(L, 3))
 	{
@@ -3071,6 +3136,8 @@ static luaL_Reg lib[] = {
 	{"P_InSpaceSector",lib_pInSpaceSector},
 	{"P_InQuicksand",lib_pInQuicksand},
 	{"P_SetObjectMomZ",lib_pSetObjectMomZ},
+	{"P_PlayJingle",lib_pPlayJingle},
+	{"P_PlayJingleMusic",lib_pPlayJingleMusic},
 	{"P_RestoreMusic",lib_pRestoreMusic},
 	{"P_SpawnShieldOrb",lib_pSpawnShieldOrb},
 	{"P_SpawnGhostMobj",lib_pSpawnGhostMobj},
@@ -3153,10 +3220,8 @@ static luaL_Reg lib[] = {
 	{"EV_CrumbleChain",lib_evCrumbleChain},
 	{"EV_StartCrumble",lib_evStartCrumble},
 
-#ifdef ESLOPE
 	// p_slopes
 	{"P_GetZAt",lib_pGetZAt},
-#endif
 
 	// r_defs
 	{"R_PointToAngle",lib_rPointToAngle},
@@ -3191,6 +3256,9 @@ static luaL_Reg lib[] = {
 	{"S_StopFadingMusic",lib_sStopFadingMusic},
 	{"S_FadeMusic",lib_sFadeMusic},
 	{"S_FadeOutStopMusic",lib_sFadeOutStopMusic},
+	{"S_GetMusicLength",lib_sGetMusicLength},
+	{"S_GetMusicPosition",lib_sGetMusicPosition},
+	{"S_SetMusicPosition",lib_sSetMusicPosition},
 	{"S_OriginPlaying",lib_sOriginPlaying},
 	{"S_IdPlaying",lib_sIdPlaying},
 	{"S_SoundPlaying",lib_sSoundPlaying},
@@ -3239,5 +3307,3 @@ int LUA_BaseLib(lua_State *L)
 	luaL_register(L, NULL, lib);
 	return 0;
 }
-
-#endif
diff --git a/src/lua_blockmaplib.c b/src/lua_blockmaplib.c
index 78a9e75a1166bb11b90b7cd7509c3fb5d5a24039..bc8d20e8eb2ba9113d027f0316cbaa3e99685ead 100644
--- a/src/lua_blockmaplib.c
+++ b/src/lua_blockmaplib.c
@@ -11,7 +11,6 @@
 /// \brief blockmap library for Lua scripting
 
 #include "doomdef.h"
-#ifdef HAVE_BLUA
 #include "p_local.h"
 #include "r_main.h" // validcount
 #include "lua_script.h"
@@ -264,5 +263,3 @@ int LUA_BlockmapLib(lua_State *L)
 	lua_register(L, "searchBlockmap", lib_searchBlockmap);
 	return 0;
 }
-
-#endif
diff --git a/src/lua_consolelib.c b/src/lua_consolelib.c
index 923722eb8d731673530e396764a6a8e9df79e752..a9fbad65f5585631490a8f7647288f0682685922 100644
--- a/src/lua_consolelib.c
+++ b/src/lua_consolelib.c
@@ -11,7 +11,6 @@
 /// \brief console modifying/etc library for Lua scripting
 
 #include "doomdef.h"
-#ifdef HAVE_BLUA
 #include "fastcmp.h"
 #include "p_local.h"
 #include "g_game.h"
@@ -551,5 +550,3 @@ int LUA_ConsoleLib(lua_State *L)
 	luaL_register(L, NULL, lib);
 	return 0;
 }
-
-#endif
diff --git a/src/lua_hook.h b/src/lua_hook.h
index 265700e4f0933bfbbe98a0f30446e7c4847144ac..244b1bbb8748c16d0322ddd13f3b87838ce2d980 100644
--- a/src/lua_hook.h
+++ b/src/lua_hook.h
@@ -10,8 +10,6 @@
 /// \file  lua_hook.h
 /// \brief hooks for Lua scripting
 
-#ifdef HAVE_BLUA
-
 #include "r_defs.h"
 #include "d_player.h"
 
@@ -58,6 +56,7 @@ enum hook {
 	hook_ViewpointSwitch,
 	hook_SeenPlayer,
 	hook_PlayerThink,
+	hook_ShouldJingleContinue,
 
 	hook_MAX // last hook
 };
@@ -110,5 +109,4 @@ UINT8 LUAh_ViewpointSwitch(player_t *player, player_t *newdisplayplayer, boolean
 boolean LUAh_SeenPlayer(player_t *player, player_t *seenfriend); // Hook for MT_NAMECHECK
 #endif
 #define LUAh_PlayerThink(player) LUAh_PlayerHook(player, hook_PlayerThink) // Hook for P_PlayerThink
-
-#endif
+boolean LUAh_ShouldJingleContinue(player_t *player, const char *musname); // Hook for whether a jingle of the given music should continue playing
diff --git a/src/lua_hooklib.c b/src/lua_hooklib.c
index 6291d5dd1f5cca1bbcdbba646378c702d1f835e4..fb89e6b026806fbffad28430cbd5f2144e1c5223 100644
--- a/src/lua_hooklib.c
+++ b/src/lua_hooklib.c
@@ -11,11 +11,10 @@
 /// \brief hooks for Lua scripting
 
 #include "doomdef.h"
-#ifdef HAVE_BLUA
 #include "doomstat.h"
 #include "p_mobj.h"
 #include "g_game.h"
-#include "r_things.h"
+#include "r_skins.h"
 #include "b_bot.h"
 #include "z_zone.h"
 
@@ -69,6 +68,7 @@ const char *const hookNames[hook_MAX+1] = {
 	"ViewpointSwitch",
 	"SeenPlayer",
 	"PlayerThink",
+	"ShouldJingleContinue",
 	NULL
 };
 
@@ -81,6 +81,7 @@ struct hook_s
 	union {
 		mobjtype_t mt;
 		char *skinname;
+		char *musname;
 		char *funcname;
 	} s;
 	boolean error;
@@ -149,6 +150,7 @@ static int lib_addHook(lua_State *L)
 		luaL_argcheck(L, hook.s.mt < NUMMOBJTYPES, 2, "invalid mobjtype_t");
 		break;
 	case hook_BotAI:
+	case hook_ShouldJingleContinue:
 		hook.s.skinname = NULL;
 		if (lua_isstring(L, 2))
 		{ // lowercase copy
@@ -1660,4 +1662,45 @@ boolean LUAh_SeenPlayer(player_t *player, player_t *seenfriend)
 }
 #endif // SEENAMES
 
-#endif
+boolean LUAh_ShouldJingleContinue(player_t *player, const char *musname)
+{
+	hook_p hookp;
+	boolean keepplaying = false;
+	if (!gL || !(hooksAvailable[hook_ShouldJingleContinue/8] & (1<<(hook_ShouldJingleContinue%8))))
+		return true;
+
+	lua_settop(gL, 0);
+	hud_running = true; // local hook
+
+	for (hookp = roothook; hookp; hookp = hookp->next)
+	{
+		if (hookp->type != hook_ShouldJingleContinue
+			|| (hookp->s.musname && strcmp(hookp->s.musname, musname)))
+			continue;
+
+		if (lua_gettop(gL) == 0)
+		{
+			LUA_PushUserdata(gL, player, META_PLAYER);
+			lua_pushstring(gL, musname);
+		}
+		lua_pushfstring(gL, FMT_HOOKID, hookp->id);
+		lua_gettable(gL, LUA_REGISTRYINDEX);
+		lua_pushvalue(gL, -3);
+		lua_pushvalue(gL, -3);
+		if (lua_pcall(gL, 2, 1, 0)) {
+			if (!hookp->error || cv_debug & DBG_LUA)
+				CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1));
+			lua_pop(gL, 1);
+			hookp->error = true;
+			continue;
+		}
+		if (!lua_isnil(gL, -1) && lua_toboolean(gL, -1))
+			keepplaying = true; // Keep playing this boolean
+		lua_pop(gL, 1);
+	}
+
+	lua_settop(gL, 0);
+	hud_running = false;
+
+	return keepplaying;
+}
diff --git a/src/lua_hudlib.c b/src/lua_hudlib.c
index 7d5f9325eae68a39681ae21b89eff2af8918f321..818e760c9d9b6b39fb1aff73394784ebf794c427 100644
--- a/src/lua_hudlib.c
+++ b/src/lua_hudlib.c
@@ -11,7 +11,6 @@
 /// \brief custom HUD rendering library for Lua scripting
 
 #include "doomdef.h"
-#ifdef HAVE_BLUA
 #include "fastcmp.h"
 #include "r_defs.h"
 #include "r_local.h"
@@ -1466,5 +1465,3 @@ void LUAh_IntermissionHUD(void)
 	lua_pop(gL, -1);
 	hud_running = false;
 }
-
-#endif
diff --git a/src/lua_infolib.c b/src/lua_infolib.c
index 6760b420341832ff678cec4b1385dd5bd30e53fa..25870d0b1cfced651926f7cbc40eeb4880c001da 100644
--- a/src/lua_infolib.c
+++ b/src/lua_infolib.c
@@ -11,7 +11,6 @@
 /// \brief infotable editing library for Lua scripting
 
 #include "doomdef.h"
-#ifdef HAVE_BLUA
 #include "fastcmp.h"
 #include "info.h"
 #include "dehacked.h"
@@ -1651,5 +1650,3 @@ int LUA_InfoLib(lua_State *L)
 
 	return 0;
 }
-
-#endif
diff --git a/src/lua_libs.h b/src/lua_libs.h
index 86fa116f104b05cbe0e84ace0e55928910e0d89a..375041506e7f7a480b1485fa7214cb526338b4c2 100644
--- a/src/lua_libs.h
+++ b/src/lua_libs.h
@@ -10,8 +10,6 @@
 /// \file  lua_libs.h
 /// \brief libraries for Lua scripting
 
-#ifdef HAVE_BLUA
-
 extern lua_State *gL;
 
 #define LREG_VALID "VALID_USERDATA"
@@ -45,11 +43,9 @@ extern lua_State *gL;
 #define META_SEG "SEG_T*"
 #define META_NODE "NODE_T*"
 #endif
-#ifdef ESLOPE
 #define META_SLOPE "PSLOPE_T*"
 #define META_VECTOR2 "VECTOR2_T"
 #define META_VECTOR3 "VECTOR3_T"
-#endif
 #define META_MAPHEADER "MAPHEADER_T*"
 
 #define META_CVAR "CONSVAR_T*"
@@ -90,5 +86,3 @@ int LUA_ThinkerLib(lua_State *L);
 int LUA_MapLib(lua_State *L);
 int LUA_BlockmapLib(lua_State *L);
 int LUA_HudLib(lua_State *L);
-
-#endif
diff --git a/src/lua_maplib.c b/src/lua_maplib.c
index 10fe94580f5b8892dcff0c2da7baa8c96be229f4..a3bdd9aa81c8b562709e5f0141bc96224e200098 100644
--- a/src/lua_maplib.c
+++ b/src/lua_maplib.c
@@ -11,14 +11,11 @@
 /// \brief game map library for Lua scripting
 
 #include "doomdef.h"
-#ifdef HAVE_BLUA
 #include "r_state.h"
 #include "p_local.h"
 #include "p_setup.h"
 #include "z_zone.h"
-#ifdef ESLOPE
 #include "p_slopes.h"
-#endif
 #include "r_main.h"
 
 #include "lua_script.h"
@@ -42,13 +39,9 @@ enum sector_e {
 	sector_heightsec,
 	sector_camsec,
 	sector_lines,
-#ifdef ESLOPE
 	sector_ffloors,
 	sector_fslope,
 	sector_cslope
-#else
-	sector_ffloors
-#endif
 };
 
 static const char *const sector_opt[] = {
@@ -65,10 +58,8 @@ static const char *const sector_opt[] = {
 	"camsec",
 	"lines",
 	"ffloors",
-#ifdef ESLOPE
 	"f_slope",
 	"c_slope",
-#endif
 	NULL};
 
 enum subsector_e {
@@ -187,10 +178,8 @@ enum ffloor_e {
 	ffloor_toplightlevel,
 	ffloor_bottomheight,
 	ffloor_bottompic,
-#ifdef ESLOPE
 	ffloor_tslope,
 	ffloor_bslope,
-#endif
 	ffloor_sector,
 	ffloor_flags,
 	ffloor_master,
@@ -207,10 +196,8 @@ static const char *const ffloor_opt[] = {
 	"toplightlevel",
 	"bottomheight",
 	"bottompic",
-#ifdef ESLOPE
 	"t_slope",
 	"b_slope",
-#endif
 	"sector", // secnum pushed as control sector userdata
 	"flags",
 	"master", // control linedef
@@ -296,7 +283,6 @@ static const char *const bbox_opt[] = {
 	"right",
 	NULL};
 
-#ifdef ESLOPE
 enum slope_e {
 	slope_valid = 0,
 	slope_o,
@@ -331,7 +317,6 @@ static const char *const vector_opt[] = {
 	"y",
 	"z",
 	NULL};
-#endif
 
 static const char *const array_opt[] ={"iterate",NULL};
 static const char *const valid_opt[] ={"valid",NULL};
@@ -577,14 +562,12 @@ static int sector_get(lua_State *L)
 		LUA_PushUserdata(L, sector->ffloors, META_FFLOOR);
 		lua_pushcclosure(L, sector_iterate, 2); // push lib_iterateFFloors and sector->ffloors as upvalues for the function
 		return 1;
-#ifdef ESLOPE
 	case sector_fslope: // f_slope
 		LUA_PushUserdata(L, sector->f_slope, META_SLOPE);
 		return 1;
 	case sector_cslope: // c_slope
 		LUA_PushUserdata(L, sector->c_slope, META_SLOPE);
 		return 1;
-#endif
 	}
 	return 0;
 }
@@ -608,10 +591,8 @@ static int sector_set(lua_State *L)
 	case sector_camsec: // camsec
 	case sector_lines: // lines
 	case sector_ffloors: // ffloors
-#ifdef ESLOPE
 	case sector_fslope: // f_slope
 	case sector_cslope: // c_slope
-#endif
 	default:
 		return luaL_error(L, "sector_t field " LUA_QS " cannot be set.", sector_opt[field]);
 	case sector_floorheight: { // floorheight
@@ -1744,14 +1725,12 @@ static int ffloor_get(lua_State *L)
 		lua_pushlstring(L, levelflat->name, i);
 		return 1;
 	}
-#ifdef ESLOPE
 	case ffloor_tslope:
 		LUA_PushUserdata(L, *ffloor->t_slope, META_SLOPE);
 		return 1;
 	case ffloor_bslope:
 		LUA_PushUserdata(L, *ffloor->b_slope, META_SLOPE);
 		return 1;
-#endif
 	case ffloor_sector:
 		LUA_PushUserdata(L, &sectors[ffloor->secnum], META_SECTOR);
 		return 1;
@@ -1791,10 +1770,8 @@ static int ffloor_set(lua_State *L)
 	switch(field)
 	{
 	case ffloor_valid: // valid
-#ifdef ESLOPE
 	case ffloor_tslope: // t_slope
 	case ffloor_bslope: // b_slope
-#endif
 	case ffloor_sector: // sector
 	case ffloor_master: // master
 	case ffloor_target: // target
@@ -1855,7 +1832,6 @@ static int ffloor_set(lua_State *L)
 	return 0;
 }
 
-#ifdef ESLOPE
 //////////////
 // pslope_t //
 //////////////
@@ -2028,7 +2004,6 @@ static int vector3_get(lua_State *L)
 
 	return 0;
 }
-#endif
 
 /////////////////////
 // mapheaderinfo[] //
@@ -2293,7 +2268,6 @@ int LUA_MapLib(lua_State *L)
 		lua_setfield(L, -2, "__index");
 	lua_pop(L, 1);
 
-#ifdef ESLOPE
 	luaL_newmetatable(L, META_SLOPE);
 		lua_pushcfunction(L, slope_get);
 		lua_setfield(L, -2, "__index");
@@ -2311,7 +2285,6 @@ int LUA_MapLib(lua_State *L)
 		lua_pushcfunction(L, vector3_get);
 		lua_setfield(L, -2, "__index");
 	lua_pop(L, 1);
-#endif
 
 	luaL_newmetatable(L, META_MAPHEADER);
 		lua_pushcfunction(L, mapheaderinfo_get);
@@ -2404,5 +2377,3 @@ int LUA_MapLib(lua_State *L)
 	lua_setglobal(L, "mapheaderinfo");
 	return 0;
 }
-
-#endif
diff --git a/src/lua_mathlib.c b/src/lua_mathlib.c
index d2a959dde4d3e779806853005e2b250f3667eb1a..215903278107416bed4d740d644cdc27a1b120f2 100644
--- a/src/lua_mathlib.c
+++ b/src/lua_mathlib.c
@@ -11,7 +11,6 @@
 /// \brief basic math library for Lua scripting
 
 #include "doomdef.h"
-#ifdef HAVE_BLUA
 //#include "fastcmp.h"
 #include "tables.h"
 #include "p_local.h"
@@ -217,5 +216,3 @@ int LUA_MathLib(lua_State *L)
 	luaL_register(L, NULL, lib);
 	return 0;
 }
-
-#endif
diff --git a/src/lua_mobjlib.c b/src/lua_mobjlib.c
index 3a6523c24c9d11ab81e53af702a6ae5fad0f79e4..8d2aad91ebf9528781487abb834bbc64c179ccb0 100644
--- a/src/lua_mobjlib.c
+++ b/src/lua_mobjlib.c
@@ -11,9 +11,8 @@
 /// \brief mobj/thing library for Lua scripting
 
 #include "doomdef.h"
-#ifdef HAVE_BLUA
 #include "fastcmp.h"
-#include "r_things.h"
+#include "r_skins.h"
 #include "p_local.h"
 #include "g_game.h"
 #include "p_setup.h"
@@ -85,9 +84,7 @@ enum mobj_e {
 	mobj_extravalue2,
 	mobj_cusval,
 	mobj_cvmem,
-#ifdef ESLOPE
 	mobj_standingslope,
-#endif
 	mobj_colorized,
 	mobj_shadowscale
 };
@@ -153,9 +150,7 @@ static const char *const mobj_opt[] = {
 	"extravalue2",
 	"cusval",
 	"cvmem",
-#ifdef ESLOPE
 	"standingslope",
-#endif
 	"colorized",
 	"shadowscale",
 	NULL};
@@ -384,11 +379,9 @@ static int mobj_get(lua_State *L)
 	case mobj_cvmem:
 		lua_pushinteger(L, mo->cvmem);
 		break;
-#ifdef ESLOPE
 	case mobj_standingslope:
 		LUA_PushUserdata(L, mo->standingslope, META_SLOPE);
 		break;
-#endif
 	case mobj_colorized:
 		lua_pushboolean(L, mo->colorized);
 		break;
@@ -717,10 +710,8 @@ static int mobj_set(lua_State *L)
 	case mobj_cvmem:
 		mo->cvmem = luaL_checkinteger(L, 3);
 		break;
-#ifdef ESLOPE
 	case mobj_standingslope:
 		return NOSET;
-#endif
 	case mobj_colorized:
 		mo->colorized = luaL_checkboolean(L, 3);
 		break;
@@ -919,5 +910,3 @@ int LUA_MobjLib(lua_State *L)
 	lua_setglobal(L, "mapthings");
 	return 0;
 }
-
-#endif
diff --git a/src/lua_playerlib.c b/src/lua_playerlib.c
index a33ecb7e0dbe64c2bd20a89ce0f1f91e3dabb145..cdece1fb79ebf9fb27eb553f6cf45ac252655973 100644
--- a/src/lua_playerlib.c
+++ b/src/lua_playerlib.c
@@ -11,7 +11,6 @@
 /// \brief player object library for Lua scripting
 
 #include "doomdef.h"
-#ifdef HAVE_BLUA
 #include "fastcmp.h"
 #include "p_mobj.h"
 #include "d_player.h"
@@ -878,5 +877,3 @@ int LUA_PlayerLib(lua_State *L)
 	lua_setglobal(L, "players");
 	return 0;
 }
-
-#endif
diff --git a/src/lua_script.c b/src/lua_script.c
index e51af60f6dcd46fec42ab05412ebcb3b9a712c1a..66222294de89c6339ff992be2251605763548996 100644
--- a/src/lua_script.c
+++ b/src/lua_script.c
@@ -11,7 +11,6 @@
 /// \brief Lua scripting basics
 
 #include "doomdef.h"
-#ifdef HAVE_BLUA
 #include "fastcmp.h"
 #include "dehacked.h"
 #include "z_zone.h"
@@ -24,9 +23,7 @@
 #include "byteptr.h"
 #include "p_saveg.h"
 #include "p_local.h"
-#ifdef ESLOPE
 #include "p_slopes.h" // for P_SlopeById
-#endif
 #ifdef LUA_ALLOW_BYTECODE
 #include "d_netfil.h" // for LUA_DumpFile
 #endif
@@ -735,9 +732,7 @@ enum
 	ARCH_NODE,
 #endif
 	ARCH_FFLOOR,
-#ifdef ESLOPE
 	ARCH_SLOPE,
-#endif
 	ARCH_MAPHEADER,
 
 	ARCH_TEND=0xFF,
@@ -762,9 +757,7 @@ static const struct {
 	{META_NODE,     ARCH_NODE},
 #endif
 	{META_FFLOOR,	ARCH_FFLOOR},
-#ifdef ESLOPE
 	{META_SLOPE,    ARCH_SLOPE},
-#endif
 	{META_MAPHEADER,   ARCH_MAPHEADER},
 	{NULL,          ARCH_NULL}
 };
@@ -1019,7 +1012,6 @@ static UINT8 ArchiveValue(int TABLESINDEX, int myindex)
 			}
 			break;
 		}
-#ifdef ESLOPE
 		case ARCH_SLOPE:
 		{
 			pslope_t *slope = *((pslope_t **)lua_touserdata(gL, myindex));
@@ -1031,7 +1023,6 @@ static UINT8 ArchiveValue(int TABLESINDEX, int myindex)
 			}
 			break;
 		}
-#endif
 		case ARCH_MAPHEADER:
 		{
 			mapheader_t *header = *((mapheader_t **)lua_touserdata(gL, myindex));
@@ -1253,11 +1244,9 @@ static UINT8 UnArchiveValue(int TABLESINDEX)
 			LUA_PushUserdata(gL, rover, META_FFLOOR);
 		break;
 	}
-#ifdef ESLOPE
 	case ARCH_SLOPE:
 		LUA_PushUserdata(gL, P_SlopeById(READUINT16(save_p)), META_SLOPE);
 		break;
-#endif
 	case ARCH_MAPHEADER:
 		LUA_PushUserdata(gL, mapheaderinfo[READUINT16(save_p)], META_MAPHEADER);
 		break;
@@ -1426,5 +1415,3 @@ int Lua_optoption(lua_State *L, int narg,
 			return i;
 	return -1;
 }
-
-#endif // HAVE_BLUA
diff --git a/src/lua_script.h b/src/lua_script.h
index 6caccd69b54d842be428e75004518877b6bb8c3e..7bdf7685b39dc3d5daf74a3a110222e71dc43984 100644
--- a/src/lua_script.h
+++ b/src/lua_script.h
@@ -10,8 +10,6 @@
 /// \file  lua_script.h
 /// \brief Lua scripting basics
 
-#ifdef HAVE_BLUA
-
 #include "m_fixed.h"
 #include "doomtype.h"
 #include "d_player.h"
@@ -102,5 +100,3 @@ void COM_Lua_f(void);
 
 #define INLEVEL if (gamestate != GS_LEVEL && !titlemapinaction)\
 return luaL_error(L, "This can only be used in a level!");
-
-#endif
diff --git a/src/lua_skinlib.c b/src/lua_skinlib.c
index 3ade06042efc9f2183c0c3107d9e795f67713a50..3e4ddb9f0806d4debc27867ddbec50eaae66ec1d 100644
--- a/src/lua_skinlib.c
+++ b/src/lua_skinlib.c
@@ -11,9 +11,8 @@
 /// \brief player skin structure library for Lua scripting
 
 #include "doomdef.h"
-#ifdef HAVE_BLUA
 #include "fastcmp.h"
-#include "r_things.h"
+#include "r_skins.h"
 #include "sounds.h"
 
 #include "lua_script.h"
@@ -358,5 +357,3 @@ int LUA_SkinLib(lua_State *L)
 
 	return 0;
 }
-
-#endif
diff --git a/src/lua_thinkerlib.c b/src/lua_thinkerlib.c
index ddb5abf72a411ee3e5b918b1ecf444b7c661ca83..82baa64693472908fb22029a7838ee6f2228e7e3 100644
--- a/src/lua_thinkerlib.c
+++ b/src/lua_thinkerlib.c
@@ -11,7 +11,6 @@
 /// \brief thinker library for Lua scripting
 
 #include "doomdef.h"
-#ifdef HAVE_BLUA
 #include "p_local.h"
 #include "lua_script.h"
 #include "lua_libs.h"
@@ -139,5 +138,3 @@ int LUA_ThinkerLib(lua_State *L)
 	lua_setglobal(L, "mobjs");
 	return 0;
 }
-
-#endif
diff --git a/src/m_cheat.c b/src/m_cheat.c
index 1431e88730336bac7a983e31d29eef6f56db89ec..4a1a4fb582ddc89cb1095926ddb7d4f9b02dfb02 100644
--- a/src/m_cheat.c
+++ b/src/m_cheat.c
@@ -788,7 +788,7 @@ void Command_CauseCfail_f(void)
 }
 #endif
 
-#if defined(HAVE_BLUA) && defined(LUA_ALLOW_BYTECODE)
+#ifdef LUA_ALLOW_BYTECODE
 void Command_Dumplua_f(void)
 {
 	if (modifiedgame)
@@ -1025,13 +1025,9 @@ static boolean OP_HeightOkay(player_t *player, UINT8 ceiling)
 
 	if (ceiling)
 	{
-#ifdef ESLOPE
 		// Truncate position to match where mapthing would be when spawned
 		// (this applies to every further P_GetZAt call as well)
 		fixed_t cheight = sec->c_slope ? P_GetZAt(sec->c_slope, player->mo->x & 0xFFFF0000, player->mo->y & 0xFFFF0000) : sec->ceilingheight;
-#else
-		fixed_t cheight = sec->ceilingheight;
-#endif
 
 		if (((cheight - player->mo->z - player->mo->height)>>FRACBITS) >= (1 << (16-ZSHIFT)))
 		{
@@ -1042,11 +1038,7 @@ static boolean OP_HeightOkay(player_t *player, UINT8 ceiling)
 	}
 	else
 	{
-#ifdef ESLOPE
 		fixed_t fheight = sec->f_slope ? P_GetZAt(sec->f_slope, player->mo->x & 0xFFFF0000, player->mo->y & 0xFFFF0000) : sec->floorheight;
-#else
-		fixed_t fheight = sec->floorheight;
-#endif
 		if (((player->mo->z - fheight)>>FRACBITS) >= (1 << (16-ZSHIFT)))
 		{
 			CONS_Printf(M_GetText("Sorry, you're too %s to place this object (max: %d %s).\n"), M_GetText("high"),
@@ -1062,9 +1054,7 @@ static mapthing_t *OP_CreateNewMapThing(player_t *player, UINT16 type, boolean c
 	mapthing_t *mt = mapthings;
 	sector_t *sec = player->mo->subsector->sector;
 
-#ifdef HAVE_BLUA
 	LUA_InvalidateMapthings();
-#endif
 
 	mapthings = Z_Realloc(mapthings, ++nummapthings * sizeof (*mapthings), PU_LEVEL, NULL);
 
@@ -1095,20 +1085,12 @@ static mapthing_t *OP_CreateNewMapThing(player_t *player, UINT16 type, boolean c
 	mt->y = (INT16)(player->mo->y>>FRACBITS);
 	if (ceiling)
 	{
-#ifdef ESLOPE
 		fixed_t cheight = sec->c_slope ? P_GetZAt(sec->c_slope, mt->x << FRACBITS, mt->y << FRACBITS) : sec->ceilingheight;
-#else
-		fixed_t cheight = sec->ceilingheight;
-#endif
 		mt->z = (UINT16)((cheight - player->mo->z - player->mo->height)>>FRACBITS);
 	}
 	else
 	{
-#ifdef ESLOPE
 		fixed_t fheight = sec->f_slope ? P_GetZAt(sec->f_slope, mt->x << FRACBITS, mt->y << FRACBITS) : sec->floorheight;
-#else
-		fixed_t fheight = sec->floorheight;
-#endif
 		mt->z = (UINT16)((player->mo->z - fheight)>>FRACBITS);
 	}
 	mt->angle = (INT16)(FixedInt(AngleFixed(player->mo->angle)));
@@ -1354,20 +1336,12 @@ void OP_ObjectplaceMovement(player_t *player)
 
 		if (!!(mobjinfo[op_currentthing].flags & MF_SPAWNCEILING) ^ !!(cv_opflags.value & MTF_OBJECTFLIP))
 		{
-#ifdef ESLOPE
 			fixed_t cheight = sec->c_slope ? P_GetZAt(sec->c_slope, player->mo->x & 0xFFFF0000, player->mo->y & 0xFFFF0000) : sec->ceilingheight;
-#else
-			fixed_t cheight = sec->ceilingheight;
-#endif
 			op_displayflags = (UINT16)((cheight - player->mo->z - mobjinfo[op_currentthing].height)>>FRACBITS);
 		}
 		else
 		{
-#ifdef ESLOPE
 			fixed_t fheight = sec->f_slope ? P_GetZAt(sec->f_slope, player->mo->x & 0xFFFF0000, player->mo->y & 0xFFFF0000) : sec->floorheight;
-#else
-			fixed_t fheight = sec->floorheight;
-#endif
 			op_displayflags = (UINT16)((player->mo->z - fheight)>>FRACBITS);
 		}
 		op_displayflags <<= ZSHIFT;
diff --git a/src/m_cheat.h b/src/m_cheat.h
index 092e51756d1621bb639756f9cee118baa61bc282..ac2540408d481f0745a756929dbeea219ecbc9bd 100644
--- a/src/m_cheat.h
+++ b/src/m_cheat.h
@@ -68,7 +68,7 @@ void Command_Toggletwod_f(void);
 #ifdef _DEBUG
 void Command_CauseCfail_f(void);
 #endif
-#if defined(HAVE_BLUA) && defined(LUA_ALLOW_BYTECODE)
+#ifdef LUA_ALLOW_BYTECODE
 void Command_Dumplua_f(void);
 #endif
 
diff --git a/src/m_cond.c b/src/m_cond.c
index 89058a488ae1833167caea247b60bc1391e62c15..0abc7adf88c7ace2907b69ea4c8277a500549b99 100644
--- a/src/m_cond.c
+++ b/src/m_cond.c
@@ -18,7 +18,7 @@
 #include "v_video.h" // video flags
 
 #include "g_game.h" // record info
-#include "r_things.h" // numskins
+#include "r_skins.h" // numskins
 #include "r_draw.h" // R_GetColorByName
 
 // Map triggers for linedef executors
diff --git a/src/m_menu.c b/src/m_menu.c
index e0becdff1bea83b70034e17633381500179839fd..f8240d40318322b1116a89c59310eaae827c25d4 100644
--- a/src/m_menu.c
+++ b/src/m_menu.c
@@ -2204,7 +2204,7 @@ menu_t OP_DataOptionsDef = DEFAULTMENUSTYLE(
 menu_t OP_ScreenshotOptionsDef =
 {
 	MN_OP_MAIN + (MN_OP_DATA << 6) + (MN_OP_SCREENSHOTS << 12),
-	"M_DATA",
+	"M_SCREEN",
 	sizeof (OP_ScreenshotOptionsMenu)/sizeof (menuitem_t),
 	&OP_DataOptionsDef,
 	OP_ScreenshotOptionsMenu,
@@ -5074,6 +5074,17 @@ static boolean M_SetNextMapOnPlatter(void)
 }
 #endif
 
+static boolean M_GametypeHasLevels(INT32 gt)
+{
+	INT32 mapnum;
+
+	for (mapnum = 0; mapnum < NUMMAPS; mapnum++)
+		if (M_CanShowLevelOnPlatter(mapnum, gt))
+			return true;
+
+	return false;
+}
+
 static INT32 M_CountRowsToShowOnPlatter(INT32 gt)
 {
 	INT32 mapnum = 0, prevmapnum = 0, col = 0, rows = 0;
@@ -5391,7 +5402,10 @@ static void M_HandleLevelPlatter(INT32 choice)
 		case KEY_RIGHTARROW:
 			if (levellistmode == LLM_CREATESERVER && !lsrow)
 			{
-				CV_AddValue(&cv_newgametype, 1);
+				INT32 startinggametype = cv_newgametype.value;
+				do
+					CV_AddValue(&cv_newgametype, 1);
+				while (cv_newgametype.value != startinggametype && !M_GametypeHasLevels(cv_newgametype.value));
 				S_StartSound(NULL,sfx_menu1);
 				lscol = 0;
 
@@ -5420,7 +5434,10 @@ static void M_HandleLevelPlatter(INT32 choice)
 		case KEY_LEFTARROW:
 			if (levellistmode == LLM_CREATESERVER && !lsrow)
 			{
-				CV_AddValue(&cv_newgametype, -1);
+				INT32 startinggametype = cv_newgametype.value;
+				do
+					CV_AddValue(&cv_newgametype, -1);
+				while (cv_newgametype.value != startinggametype && !M_GametypeHasLevels(cv_newgametype.value));
 				S_StartSound(NULL,sfx_menu1);
 				lscol = 0;
 
@@ -6657,12 +6674,6 @@ static void M_HandleAddons(INT32 choice)
 							M_AddonExec(KEY_ENTER);
 							break;
 						case EXT_LUA:
-#ifndef HAVE_BLUA
-							S_StartSound(NULL, sfx_lose);
-							M_StartMessage(va("%c%s\x80\nThis copy of SRB2 was compiled\nwithout support for .lua files.\n\n(Press a key)\n", ('\x80' + (highlightflags>>V_CHARCOLORSHIFT)), dirmenu[dir_on[menudepthleft]]+DIR_STRING),NULL,MM_NOTHING);
-							break;
-#endif
-						/* FALLTHRU */
 						case EXT_SOC:
 						case EXT_WAD:
 #ifdef USE_KART
@@ -10099,13 +10110,13 @@ static void M_ReplayTimeAttack(INT32 choice)
 static void M_EraseGuest(INT32 choice)
 {
 	const char *rguest = va("%s"PATHSEP"replay"PATHSEP"%s"PATHSEP"%s-guest.lmp", srb2home, timeattackfolder, G_BuildMapName(cv_nextmap.value));
-	(void)choice;
-	if (FIL_FileExists(rguest))
-		remove(rguest);
-	if (currentMenu == &SP_NightsGuestReplayDef)
-		M_SetupNextMenu(&SP_NightsAttackDef);
-	else
-		M_SetupNextMenu(&SP_TimeAttackDef);
+
+	if (choice == 'y' || choice == KEY_ENTER)
+	{
+		if (FIL_FileExists(rguest))
+			remove(rguest);
+	}
+	M_SetupNextMenu(currentMenu->prevMenu->prevMenu);
 	Nextmap_OnChange();
 	M_StartMessage(M_GetText("Guest replay data erased.\n"),NULL,MM_NOTHING);
 }
@@ -10394,7 +10405,7 @@ static void M_DrawConnectMenu(void)
 	for (i = 0; i < min(serverlistcount - serverlistpage * SERVERS_PER_PAGE, SERVERS_PER_PAGE); i++)
 	{
 		INT32 slindex = i + serverlistpage * SERVERS_PER_PAGE;
-		UINT32 globalflags = ((serverlist[slindex].info.numberofplayer >= serverlist[slindex].info.maxplayer) ? V_TRANSLUCENT : 0)
+		UINT32 globalflags = (serverlist[slindex].info.refusereason ? V_TRANSLUCENT : 0)
 			|((itemOn == FIRSTSERVERLINE+i) ? V_YELLOWMAP : 0)|V_ALLOWLOWERCASE;
 
 		V_DrawString(currentMenu->x, S_LINEY(i), globalflags, serverlist[slindex].info.servername);
diff --git a/src/m_menu.h b/src/m_menu.h
index 18b681ff034c5e4d949c0d0ae16fbe4b8ad58f64..e7270380d503a84c1beb8cfe6e3f4fd69fc5bdb1 100644
--- a/src/m_menu.h
+++ b/src/m_menu.h
@@ -15,9 +15,10 @@
 #ifndef __X_MENU__
 #define __X_MENU__
 
+#include "doomstat.h" // for NUMGAMETYPES
 #include "d_event.h"
 #include "command.h"
-#include "r_things.h" // for SKINNAMESIZE
+#include "r_skins.h" // for SKINNAMESIZE
 #include "f_finale.h" // for ttmode_enum
 
 //
diff --git a/src/p_enemy.c b/src/p_enemy.c
index 5d067ebc3c24f0af29b4bda036ea14c103a99b18..09d33c5370da8c35c8b7ba84342a2c5890f3a481 100644
--- a/src/p_enemy.c
+++ b/src/p_enemy.c
@@ -21,7 +21,7 @@
 #include "s_sound.h"
 #include "m_random.h"
 #include "m_misc.h"
-#include "r_things.h"
+#include "r_skins.h"
 #include "i_video.h"
 #include "z_zone.h"
 #include "lua_hook.h"
@@ -30,9 +30,7 @@
 #include "hardware/hw3sound.h"
 #endif
 
-#ifdef HAVE_BLUA
 boolean LUA_CallAction(const char *action, mobj_t *actor);
-#endif
 
 player_t *stplyr;
 INT32 var1;
@@ -981,10 +979,8 @@ void A_Look(mobj_t *actor)
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_Look", actor))
 		return;
-#endif
 
 	if (!P_LookForPlayers(actor, locvar1 & 65535, false , FixedMul((locvar1 >> 16)*FRACUNIT, actor->scale)))
 		return;
@@ -1016,10 +1012,8 @@ void A_Chase(mobj_t *actor)
 	INT32 delta;
 	INT32 locvar1 = var1;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_Chase", actor))
 		return;
-#endif
 
 	I_Assert(actor != NULL);
 	I_Assert(!P_MobjWasRemoved(actor));
@@ -1109,10 +1103,8 @@ void A_FaceStabChase(mobj_t *actor)
 {
 	INT32 delta;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_FaceStabChase", actor))
 		return;
-#endif
 
 	if (actor->reactiontime)
 		actor->reactiontime--;
@@ -1233,10 +1225,8 @@ void A_FaceStabRev(mobj_t *actor)
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_FaceStabRev", actor))
 		return;
-#endif
 
 	if (!actor->target)
 	{
@@ -1278,10 +1268,8 @@ void A_FaceStabHurl(mobj_t *actor)
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_FaceStabHurl", actor))
 		return;
-#endif
 
 	if (actor->target)
 	{
@@ -1368,13 +1356,10 @@ void A_FaceStabHurl(mobj_t *actor)
 //
 void A_FaceStabMiss(mobj_t *actor)
 {
-	//INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_FaceStabMiss", actor))
 		return;
-#endif
 
 	if (++actor->extravalue1 >= 3)
 	{
@@ -1408,10 +1393,8 @@ void A_StatueBurst(mobj_t *actor)
 	mobjtype_t chunktype = (mobjtype_t)actor->info->raisestate;
 	mobj_t *new;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_StatueBurst", actor))
 		return;
-#endif
 
 	if (!locvar1 || !(new = P_SpawnMobjFromMobj(actor, 0, 0, 0, locvar1)))
 		return;
@@ -1460,10 +1443,9 @@ void A_StatueBurst(mobj_t *actor)
 //
 void A_JetJawRoam(mobj_t *actor)
 {
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_JetJawRoam", actor))
 		return;
-#endif
+
 	if (actor->reactiontime)
 	{
 		actor->reactiontime--;
@@ -1489,10 +1471,9 @@ void A_JetJawRoam(mobj_t *actor)
 void A_JetJawChomp(mobj_t *actor)
 {
 	INT32 delta;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_JetJawChomp", actor))
 		return;
-#endif
 
 	// turn towards movement direction if not there yet
 	if (actor->movedir < NUMDIRS)
@@ -1538,10 +1519,9 @@ void A_PointyThink(mobj_t *actor)
 	boolean firsttime = true;
 	INT32 sign;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_PointyThink", actor))
 		return;
-#endif
+
 	actor->momx = actor->momy = actor->momz = 0;
 
 	// Find nearest player
@@ -1637,10 +1617,9 @@ void A_CheckBuddy(mobj_t *actor)
 {
 	INT32 locvar1 = var1;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_CheckBuddy", actor))
 		return;
-#endif
+
 	if (locvar1 && (!actor->tracer || actor->tracer->health <= 0))
 		P_RemoveMobj(actor);
 	else if (!locvar1 && (!actor->target || actor->target->health <= 0))
@@ -1680,11 +1659,9 @@ void A_HoodFire(mobj_t *actor)
 {
 	mobj_t *arrow;
 	INT32 locvar1 = var1;
-	//INT32 locvar2 = var2;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_HoodFire", actor))
 		return;
-#endif
 
 	// Check target first.
 	if (!actor->target)
@@ -1714,10 +1691,9 @@ void A_HoodThink(mobj_t *actor)
 {
 	fixed_t dx, dy, dz, dm;
 	boolean checksight;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_HoodThink", actor))
 		return;
-#endif
 
 	// Check target first.
 	if (!actor->target)
@@ -1783,10 +1759,8 @@ void A_HoodThink(mobj_t *actor)
 //
 void A_HoodFall(mobj_t *actor)
 {
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_HoodFall", actor))
 		return;
-#endif
 
 	if (!P_IsObjectOnGround(actor))
 		return;
@@ -1805,10 +1779,8 @@ void A_HoodFall(mobj_t *actor)
 //
 void A_ArrowBonks(mobj_t *actor)
 {
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_ArrowBonks", actor))
 		return;
-#endif
 
 	if (((actor->eflags & MFE_VERTICALFLIP) && actor->z + actor->height >= actor->ceilingz)
 		|| (!(actor->eflags & MFE_VERTICALFLIP) && actor->z <= actor->floorz))
@@ -1830,10 +1802,8 @@ void A_ArrowBonks(mobj_t *actor)
 //
 void A_SnailerThink(mobj_t *actor)
 {
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_SnailerThink", actor))
 		return;
-#endif
 
 	if (!actor->target || !(actor->target->flags & MF_SHOOTABLE))
 	{
@@ -1905,10 +1875,8 @@ void A_SnailerThink(mobj_t *actor)
 //
 void A_SharpChase(mobj_t *actor)
 {
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_SharpChase", actor))
 		return;
-#endif
 
 	if (actor->reactiontime)
 	{
@@ -1963,10 +1931,8 @@ void A_SharpSpin(mobj_t *actor)
 	INT32 locvar2 = var2;
 	angle_t oldang = actor->angle;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_SharpSpin", actor))
 		return;
-#endif
 
 	if (actor->threshold && actor->target)
 	{
@@ -1998,10 +1964,8 @@ void A_SharpSpin(mobj_t *actor)
 //
 void A_SharpDecel(mobj_t *actor)
 {
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_SharpDecel", actor))
 		return;
-#endif
 
 	if (actor->momx > 2 || actor->momy > 2)
 	{
@@ -2024,10 +1988,9 @@ void A_CrushstaceanWalk(mobj_t *actor)
 	INT32 locvar1 = (var1 ? var1 : (INT32)actor->info->speed);
 	INT32 locvar2 = (var2 ? var2 : (INT32)actor->info->spawnstate);
 	angle_t ang = actor->angle + ((actor->flags2 & MF2_AMBUSH) ? ANGLE_90 : ANGLE_270);
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_CrushstaceanWalk", actor))
 		return;
-#endif
 
 	actor->reactiontime--;
 
@@ -2053,12 +2016,10 @@ void A_CrushstaceanWalk(mobj_t *actor)
 //
 void A_CrushstaceanPunch(mobj_t *actor)
 {
-	//INT32 locvar1 = var1;
 	INT32 locvar2 = (var2 ? var2 : (INT32)actor->info->spawnstate);
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_CrushstaceanPunch", actor))
 		return;
-#endif
 
 	if (!actor->tracer)
 		return;
@@ -2088,10 +2049,9 @@ void A_CrushclawAim(mobj_t *actor)
 	INT32 locvar2 = var2;
 	mobj_t *crab = actor->tracer;
 	angle_t ang;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_CrushclawAim", actor))
 		return;
-#endif
 
 	if (!crab)
 	{
@@ -2150,10 +2110,9 @@ void A_CrushclawLaunch(mobj_t *actor)
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
 	mobj_t *crab = actor->tracer;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_CrushclawLaunch", actor))
 		return;
-#endif
 
 	if (!crab)
 	{
@@ -2283,10 +2242,8 @@ void A_CrushclawLaunch(mobj_t *actor)
 //
 void A_VultureVtol(mobj_t *actor)
 {
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_VultureVtol", actor))
 		return;
-#endif
 
 	if (!actor->target)
 		return;
@@ -2320,10 +2277,8 @@ void A_VultureVtol(mobj_t *actor)
 //
 void A_VultureCheck(mobj_t *actor)
 {
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_VultureCheck", actor))
 		return;
-#endif
 
 	if (actor->momx || actor->momy)
 		return;
@@ -2378,10 +2333,8 @@ void A_VultureHover(mobj_t *actor)
 	fixed_t memz = actor->z;
 	SINT8 i;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_VultureHover", actor))
 		return;
-#endif
 
 	if (!actor->target || P_MobjWasRemoved(actor->target))
 	{
@@ -2442,10 +2395,8 @@ void A_VultureBlast(mobj_t *actor)
 	angle_t faa;
 	fixed_t faacos, faasin;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_VultureBlast", actor))
 		return;
-#endif
 
 	S_StartSound(actor, actor->info->attacksound);
 
@@ -2483,10 +2434,8 @@ void A_VultureFly(mobj_t *actor)
 	mobj_t *dust;
 	fixed_t momm;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_VultureFly", actor))
 		return;
-#endif
 
 	if (!actor->target || P_MobjWasRemoved(actor->target))
 	{
@@ -2577,10 +2526,9 @@ void A_SkimChase(mobj_t *actor)
 {
 	INT32 delta;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_SkimChase", actor))
 		return;
-#endif
+
 	if (actor->reactiontime)
 		actor->reactiontime--;
 
@@ -2664,10 +2612,9 @@ nomissile:
 //
 void A_FaceTarget(mobj_t *actor)
 {
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_FaceTarget", actor))
 		return;
-#endif
+
 	if (!actor->target)
 		return;
 
@@ -2683,10 +2630,9 @@ void A_FaceTarget(mobj_t *actor)
 //
 void A_FaceTracer(mobj_t *actor)
 {
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_FaceTracer", actor))
 		return;
-#endif
+
 	if (!actor->tracer)
 		return;
 
@@ -2713,10 +2659,9 @@ void A_LobShot(mobj_t *actor)
 	fixed_t vertical, horizontal;
 	fixed_t airtime = var2 & 65535;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_LobShot", actor))
 		return;
-#endif
+
 	if (!actor->target)
 		return;
 
@@ -2814,10 +2759,9 @@ void A_FireShot(mobj_t *actor)
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_FireShot", actor))
 		return;
-#endif
+
 	if (!actor->target)
 		return;
 
@@ -2853,10 +2797,9 @@ void A_SuperFireShot(mobj_t *actor)
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_SuperFireShot", actor))
 		return;
-#endif
+
 	if (!actor->target)
 		return;
 
@@ -2901,10 +2844,9 @@ void A_BossFireShot(mobj_t *actor)
 	INT32 locvar2 = var2;
 	mobj_t *missile;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_BossFireShot", actor))
 		return;
-#endif
+
 	if (!actor->target)
 		return;
 
@@ -2986,10 +2928,8 @@ void A_Boss7FireMissiles(mobj_t *actor)
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_Boss7FireMissiles", actor))
 		return;
-#endif
 
 	if (!actor->target)
 	{
@@ -3050,10 +2990,9 @@ void A_Boss1Laser(mobj_t *actor)
 	mobj_t *point;
 	tic_t dur;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_Boss1Laser", actor))
 		return;
-#endif
+
 	if (!actor->target)
 		return;
 
@@ -3175,10 +3114,9 @@ void A_FocusTarget(mobj_t *actor)
 {
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_FocusTarget", actor))
 		return;
-#endif
 
 	if (actor->target)
 	{
@@ -3227,10 +3165,10 @@ void A_Boss4Reverse(mobj_t *actor)
 {
 	sfxenum_t locvar1 = (sfxenum_t)var1;
 	sfxenum_t locvar2 = (sfxenum_t)var2;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_Boss4Reverse", actor))
 		return;
-#endif
+
 	actor->reactiontime = 0;
 	if (actor->movedir < 3)
 	{
@@ -3262,10 +3200,10 @@ void A_Boss4Reverse(mobj_t *actor)
 void A_Boss4SpeedUp(mobj_t *actor)
 {
 	sfxenum_t locvar1 = (sfxenum_t)var1;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_Boss4SpeedUp", actor))
 		return;
-#endif
+
 	S_StartSound(NULL, locvar1);
 	actor->reactiontime = 2;
 }
@@ -3280,10 +3218,10 @@ void A_Boss4SpeedUp(mobj_t *actor)
 void A_Boss4Raise(mobj_t *actor)
 {
 	sfxenum_t locvar1 = (sfxenum_t)var1;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_Boss4Raise", actor))
 		return;
-#endif
+
 	S_StartSound(NULL, locvar1);
 	actor->reactiontime = 1;
 }
@@ -3312,10 +3250,9 @@ void A_SkullAttack(mobj_t *actor)
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_SkullAttack", actor))
 		return;
-#endif
+
 	if (!actor->target)
 		return;
 
@@ -3431,10 +3368,9 @@ void A_BossZoom(mobj_t *actor)
 	angle_t an;
 	INT32 dist;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_BossZoom", actor))
 		return;
-#endif
+
 	if (!actor->target)
 		return;
 
@@ -3472,10 +3408,9 @@ void A_BossScream(mobj_t *actor)
 	INT32 locvar2 = var2;
 	mobjtype_t explodetype;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_BossScream", actor))
 		return;
-#endif
+
 	if (locvar1 & 1)
 		fa = (FixedAngle(P_RandomKey(360)*FRACUNIT)>>ANGLETOFINESHIFT) & FINEMASK;
 	else
@@ -3518,10 +3453,9 @@ void A_BossScream(mobj_t *actor)
 //
 void A_Scream(mobj_t *actor)
 {
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_Scream", actor))
 		return;
-#endif
+
 	if (actor->tracer && (actor->tracer->type == MT_SHELL || actor->tracer->type == MT_FIREBALL))
 		S_StartScreamSound(actor, sfx_mario2);
 	else if (actor->info->deathsound)
@@ -3537,10 +3471,9 @@ void A_Scream(mobj_t *actor)
 //
 void A_Pain(mobj_t *actor)
 {
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_Pain", actor))
 		return;
-#endif
+
 	if (actor->info->painsound)
 		S_StartSound(actor, actor->info->painsound);
 
@@ -3559,10 +3492,9 @@ void A_Fall(mobj_t *actor)
 {
 	INT32 locvar1 = var1;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_Fall", actor))
 		return;
-#endif
+
 	// actor is on ground, it can be walked over
 	actor->flags &= ~MF_SOLID;
 
@@ -3592,10 +3524,9 @@ void A_1upThinker(mobj_t *actor)
 	fixed_t temp;
 	INT32 closestplayer = -1;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_1upThinker", actor))
 		return;
-#endif
+
 	for (i = 0; i < MAXPLAYERS; i++)
 	{
 		if (!playeringame[i] || players[i].bot || players[i].spectator)
@@ -3659,10 +3590,8 @@ void A_MonitorPop(mobj_t *actor)
 	mobjtype_t item = 0;
 	mobj_t *newmobj;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_MonitorPop", actor))
 		return;
-#endif
 
 	// Spawn the "pop" explosion.
 	if (actor->info->deathsound)
@@ -3742,10 +3671,8 @@ void A_GoldMonitorPop(mobj_t *actor)
 	mobjtype_t item = 0;
 	mobj_t *newmobj;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_GoldMonitorPop", actor))
 		return;
-#endif
 
 	// Don't spawn the "pop" explosion, because the monitor isn't broken.
 	if (actor->info->deathsound)
@@ -3827,10 +3754,8 @@ void A_GoldMonitorPop(mobj_t *actor)
 //
 void A_GoldMonitorRestore(mobj_t *actor)
 {
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_GoldMonitorRestore", actor))
 		return;
-#endif
 
 	actor->flags |= MF_MONITOR|MF_SHOOTABLE;
 	actor->health = 1; // Just in case.
@@ -3847,10 +3772,8 @@ void A_GoldMonitorSparkle(mobj_t *actor)
 {
 	fixed_t i, ngangle, xofs, yofs;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_GoldMonitorSparkle", actor))
 		return;
-#endif
 
 	ngangle = FixedAngle(((leveltime * 21) % 360) << FRACBITS);
 	xofs = FINESINE((ngangle>>ANGLETOFINESHIFT) & FINEMASK)   * (actor->radius>>FRACBITS);
@@ -3870,10 +3793,10 @@ void A_GoldMonitorSparkle(mobj_t *actor)
 void A_Explode(mobj_t *actor)
 {
 	INT32 locvar1 = var1;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_Explode", actor))
 		return;
-#endif
+
 	P_RadiusAttack(actor, actor->target, actor->info->damage, locvar1);
 }
 
@@ -3890,10 +3813,9 @@ void A_BossDeath(mobj_t *mo)
 	mobj_t *mo2;
 	line_t junk;
 	INT32 i;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_BossDeath", mo))
 		return;
-#endif
 
 	if (mo->spawnpoint && mo->spawnpoint->extrainfo)
 		P_LinedefExecute(LE_BOSSDEAD+(mo->spawnpoint->extrainfo*LE_PARAMWIDTH), mo, NULL);
@@ -3973,12 +3895,10 @@ void A_BossDeath(mobj_t *mo)
 	}
 
 bossjustdie:
-#ifdef HAVE_BLUA
 	if (LUAh_BossDeath(mo))
 		return;
 	else if (P_MobjWasRemoved(mo))
 		return;
-#endif
 
 	// Spawn your junk
 	switch (mo->type)
@@ -4202,10 +4122,9 @@ void A_CustomPower(mobj_t *actor)
 	INT32 locvar2 = var2;
 	boolean spawnshield = false;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_CustomPower", actor))
 		return;
-#endif
+
 	if (!actor->target || !actor->target->player)
 	{
 		CONS_Debug(DBG_GAMELOGIC, "Powerup has no target.\n");
@@ -4243,10 +4162,9 @@ void A_GiveWeapon(mobj_t *actor)
 	player_t *player;
 	INT32 locvar1 = var1;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_GiveWeapon", actor))
 		return;
-#endif
+
 	if (!actor->target || !actor->target->player)
 	{
 		CONS_Debug(DBG_GAMELOGIC, "Powerup has no target.\n");
@@ -4277,10 +4195,9 @@ void A_RingBox(mobj_t *actor)
 {
 	player_t *player;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_RingBox", actor))
 		return;
-#endif
+
 	if (!actor->target || !actor->target->player)
 	{
 		CONS_Debug(DBG_GAMELOGIC, "Powerup has no target.\n");
@@ -4305,10 +4222,9 @@ void A_Invincibility(mobj_t *actor)
 {
 	player_t *player;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_Invincibility", actor))
 		return;
-#endif
+
 	if (!actor->target || !actor->target->player)
 	{
 		CONS_Debug(DBG_GAMELOGIC, "Powerup has no target.\n");
@@ -4339,10 +4255,9 @@ void A_SuperSneakers(mobj_t *actor)
 {
 	player_t *player;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_SuperSneakers", actor))
 		return;
-#endif
+
 	if (!actor->target || !actor->target->player)
 	{
 		CONS_Debug(DBG_GAMELOGIC, "Powerup has no target.\n");
@@ -4375,10 +4290,9 @@ void A_AwardScore(mobj_t *actor)
 {
 	player_t *player;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_AwardScore", actor))
 		return;
-#endif
+
 	if (!actor->target || !actor->target->player)
 	{
 		CONS_Debug(DBG_GAMELOGIC, "Powerup has no target.\n");
@@ -4403,10 +4317,9 @@ void A_ExtraLife(mobj_t *actor)
 {
 	player_t *player;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_ExtraLife", actor))
 		return;
-#endif
+
 	if (!actor->target || !actor->target->player)
 	{
 		CONS_Debug(DBG_GAMELOGIC, "Powerup has no target.\n");
@@ -4442,10 +4355,9 @@ void A_GiveShield(mobj_t *actor)
 	player_t *player;
 	UINT16 locvar1 = var1;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_GiveShield", actor))
 		return;
-#endif
+
 	if (!actor->target || !actor->target->player)
 	{
 		CONS_Debug(DBG_GAMELOGIC, "Powerup has no target.\n");
@@ -4469,10 +4381,9 @@ void A_GravityBox(mobj_t *actor)
 {
 	player_t *player;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_GravityBox", actor))
 		return;
-#endif
+
 	if (!actor->target || !actor->target->player)
 	{
 		CONS_Debug(DBG_GAMELOGIC, "Powerup has no target.\n");
@@ -4495,10 +4406,9 @@ void A_GravityBox(mobj_t *actor)
 //
 void A_ScoreRise(mobj_t *actor)
 {
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_ScoreRise", actor))
 		return;
-#endif
+
 	// make logo rise!
 	P_SetObjectMomZ(actor, actor->info->speed, false);
 }
@@ -4515,10 +4425,9 @@ void A_BunnyHop(mobj_t *actor)
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_BunnyHop", actor))
 		return;
-#endif
+
 	if (((actor->eflags & MFE_VERTICALFLIP) && actor->z + actor->height >= actor->ceilingz)
 		|| (!(actor->eflags & MFE_VERTICALFLIP) && actor->z <= actor->floorz))
 	{
@@ -4539,10 +4448,10 @@ void A_BubbleSpawn(mobj_t *actor)
 	INT32 i, locvar1 = var1;
 	UINT8 prandom;
 	mobj_t *bubble = NULL;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_BubbleSpawn", actor))
 		return;
-#endif
+
 	if (!(actor->eflags & MFE_UNDERWATER))
 	{
 		// Don't draw or spawn bubbles above water
@@ -4592,10 +4501,10 @@ void A_FanBubbleSpawn(mobj_t *actor)
 	UINT8 prandom;
 	mobj_t *bubble = NULL;
 	fixed_t hz = actor->z + (4*actor->height)/5;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_FanBubbleSpawn", actor))
 		return;
-#endif
+
 	if (!(actor->eflags & MFE_UNDERWATER))
 		return;
 
@@ -4639,10 +4548,9 @@ void A_BubbleRise(mobj_t *actor)
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_BubbleRise", actor))
 		return;
-#endif
+
 	if (actor->type == MT_EXTRALARGEBUBBLE)
 		P_SetObjectMomZ(actor, FixedDiv(6*FRACUNIT,5*FRACUNIT), false); // make bubbles rise!
 	else
@@ -4676,10 +4584,9 @@ void A_BubbleRise(mobj_t *actor)
 //
 void A_BubbleCheck(mobj_t *actor)
 {
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_BubbleCheck", actor))
 		return;
-#endif
+
 	if (actor->eflags & MFE_UNDERWATER)
 		actor->flags2 &= ~MF2_DONTDRAW; // underwater so draw
 	else
@@ -4695,10 +4602,9 @@ void A_BubbleCheck(mobj_t *actor)
 //
 void A_AttractChase(mobj_t *actor)
 {
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_AttractChase", actor))
 		return;
-#endif
+
 	if (actor->flags2 & MF2_NIGHTSPULL || !actor->health)
 		return;
 
@@ -4766,10 +4672,9 @@ void A_DropMine(mobj_t *actor)
 	INT32 locvar2 = var2;
 	fixed_t z;
 	mobj_t *mine;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_DropMine", actor))
 		return;
-#endif
 
 	if (locvar2 & 65535)
 	{
@@ -4815,10 +4720,9 @@ void A_FishJump(mobj_t *actor)
 {
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_FishJump", actor))
 		return;
-#endif
 
 	if (locvar2)
 	{
@@ -4867,10 +4771,9 @@ void A_ThrownRing(mobj_t *actor)
 	INT32 stop;
 	player_t *player;
 	fixed_t dist;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_ThrownRing", actor))
 		return;
-#endif
 
 	if (leveltime % (TICRATE/7) == 0)
 	{
@@ -5025,10 +4928,9 @@ void A_ThrownRing(mobj_t *actor)
 //
 void A_SetSolidSteam(mobj_t *actor)
 {
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_SetSolidSteam", actor))
 		return;
-#endif
+
 	actor->flags &= ~MF_NOCLIP;
 	actor->flags |= MF_SOLID;
 	if (!(actor->flags2 & MF2_AMBUSH))
@@ -5057,10 +4959,9 @@ void A_SetSolidSteam(mobj_t *actor)
 //
 void A_UnsetSolidSteam(mobj_t *actor)
 {
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_UnsetSolidSteam", actor))
 		return;
-#endif
+
 	actor->flags &= ~MF_SOLID;
 	actor->flags |= MF_NOCLIP;
 }
@@ -5078,10 +4979,8 @@ void A_SignSpin(mobj_t *actor)
 	INT16 i;
 	angle_t rotateangle = FixedAngle(locvar1 << FRACBITS);
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_SignSpin", actor))
 		return;
-#endif
 
 	if (P_IsObjectOnGround(actor) && P_MobjFlip(actor) * actor->momz <= 0)
 	{
@@ -5149,10 +5048,8 @@ void A_SignPlayer(mobj_t *actor)
 	UINT8 facecolor, signcolor = (UINT8)locvar2;
 	UINT32 signframe = states[actor->info->raisestate].frame;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_SignPlayer", actor))
 		return;
-#endif
 
 	if (actor->tracer == NULL || locvar1 < -3 || locvar1 >= numskins || signcolor >= MAXTRANSLATIONS)
 		return;
@@ -5280,10 +5177,10 @@ void A_SignPlayer(mobj_t *actor)
 void A_OverlayThink(mobj_t *actor)
 {
 	fixed_t destx, desty;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_OverlayThink", actor))
 		return;
-#endif
+
 	if (!actor->target)
 		return;
 
@@ -5332,10 +5229,9 @@ void A_OverlayThink(mobj_t *actor)
 void A_JetChase(mobj_t *actor)
 {
 	fixed_t thefloor;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_JetChase", actor))
 		return;
-#endif
 
 	if (actor->flags2 & MF2_AMBUSH)
 		return;
@@ -5429,10 +5325,9 @@ void A_JetbThink(mobj_t *actor)
 {
 	sector_t *nextsector;
 	fixed_t thefloor;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_JetbThink", actor))
 		return;
-#endif
 
 	if (actor->z >= actor->waterbottom && actor->watertop > actor->floorz
 		&& actor->z > actor->watertop - FixedMul(256*FRACUNIT, actor->scale))
@@ -5495,10 +5390,9 @@ void A_JetbThink(mobj_t *actor)
 void A_JetgShoot(mobj_t *actor)
 {
 	fixed_t dist;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_JetgShoot", actor))
 		return;
-#endif
 
 	if (!actor->target)
 		return;
@@ -5536,10 +5430,9 @@ void A_JetgShoot(mobj_t *actor)
 void A_ShootBullet(mobj_t *actor)
 {
 	fixed_t dist;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_ShootBullet", actor))
 		return;
-#endif
 
 	if (!actor->target)
 		return;
@@ -5598,10 +5491,8 @@ void A_MinusDigging(mobj_t *actor)
 	fixed_t mz = (actor->eflags & MFE_VERTICALFLIP) ? actor->ceilingz : actor->floorz;
 	mobj_t *par;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_MinusDigging", actor))
 		return;
-#endif
 
 	if (!actor->target)
 	{
@@ -5681,10 +5572,8 @@ void A_MinusPopup(mobj_t *actor)
 	angle_t ani = FixedAngle(FRACUNIT*360/num);
 	INT32 i;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_MinusPopup", actor))
 		return;
-#endif
 
 	if (actor->eflags & MFE_VERTICALFLIP)
 		actor->momz = -10*FRACUNIT;
@@ -5718,10 +5607,8 @@ void A_MinusCheck(mobj_t *actor)
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_MinusCheck", actor))
 		return;
-#endif
 
 	if (((actor->eflags & MFE_VERTICALFLIP) && actor->z + actor->height >= actor->ceilingz) || (!(actor->eflags & MFE_VERTICALFLIP) && actor->z <= actor->floorz))
 	{
@@ -5751,10 +5638,9 @@ void A_MinusCheck(mobj_t *actor)
 //
 void A_ChickenCheck(mobj_t *actor)
 {
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_ChickenCheck", actor))
 		return;
-#endif
+
 	if ((!(actor->eflags & MFE_VERTICALFLIP) && actor->z <= actor->floorz)
 	|| (actor->eflags & MFE_VERTICALFLIP && actor->z + actor->height >= actor->ceilingz))
 	{
@@ -5782,10 +5668,9 @@ void A_JetgThink(mobj_t *actor)
 	sector_t *nextsector;
 
 	fixed_t thefloor;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_JetgThink", actor))
 		return;
-#endif
 
 	if (actor->z >= actor->waterbottom && actor->watertop > actor->floorz
 		&& actor->z > actor->watertop - FixedMul(256*FRACUNIT, actor->scale))
@@ -5834,10 +5719,8 @@ void A_JetgThink(mobj_t *actor)
 //
 void A_MouseThink(mobj_t *actor)
 {
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_MouseThink", actor))
 		return;
-#endif
 
 	if (actor->reactiontime)
 		actor->reactiontime--;
@@ -5872,10 +5755,9 @@ void A_DetonChase(mobj_t *actor)
 {
 	angle_t exact;
 	fixed_t xydist, dist;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_DetonChase", actor))
 		return;
-#endif
 
 	// modify tracer threshold
 	if (!actor->tracer || actor->tracer->health <= 0)
@@ -6020,10 +5902,9 @@ void A_CapeChase(mobj_t *actor)
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
 	angle_t angle;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_CapeChase", actor))
 		return;
-#endif
 
 	CONS_Debug(DBG_GAMELOGIC, "A_CapeChase called from object type %d, var1: %d, var2: %d\n", actor->type, locvar1, locvar2);
 
@@ -6081,10 +5962,9 @@ void A_RotateSpikeBall(mobj_t *actor)
 {
 	INT32 locvar1 = var1;
 	const fixed_t radius = FixedMul(12*actor->info->speed, actor->scale);
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_RotateSpikeBall", actor))
 		return;
-#endif
 
 	if (!((!locvar1 && (actor->target)) || (locvar1 && (actor->tracer))))// This should NEVER happen.
 	{
@@ -6134,10 +6014,8 @@ void A_UnidusBall(mobj_t *actor)
 	INT32 locvar1 = var1;
 	boolean canthrow = false;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_UnidusBall", actor))
 		return;
-#endif
 
 	actor->angle += ANGLE_11hh;
 
@@ -6232,10 +6110,9 @@ void A_RockSpawn(mobj_t *actor)
 	line_t *line;
 	fixed_t dist;
 	fixed_t randomoomph;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_RockSpawn", actor))
 		return;
-#endif
 
 	if (i == -1)
 	{
@@ -6286,10 +6163,9 @@ void A_SlingAppear(mobj_t *actor)
 {
 	UINT8 mlength = 4;
 	mobj_t *spawnee, *hprev;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_SlingAppear", actor))
 		return;
-#endif
 
 	P_UnsetThingPosition(actor);
 	actor->flags &= ~(MF_NOBLOCKMAP|MF_NOCLIP|MF_NOGRAVITY|MF_NOCLIPHEIGHT);
@@ -6337,10 +6213,9 @@ void A_SetFuse(mobj_t *actor)
 {
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_SetFuse", actor))
 		return;
-#endif
 
 	if ((!actor->fuse || (locvar2 >> 16)) && (locvar2 >> 16) != 2) // set the actor's fuse value
 		actor->fuse = locvar1;
@@ -6367,10 +6242,9 @@ void A_CrawlaCommanderThink(mobj_t *actor)
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
 	boolean hovermode = (actor->health > 1 || actor->fuse);
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_CrawlaCommanderThink", actor))
 		return;
-#endif
 
 	if (actor->z >= actor->waterbottom && actor->watertop > actor->floorz
 		&& actor->z > actor->watertop - FixedMul(256*FRACUNIT, actor->scale))
@@ -6526,10 +6400,9 @@ void A_RingExplode(mobj_t *actor)
 	mobj_t *mo2;
 	thinker_t *th;
 	angle_t d;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_RingExplode", actor))
 		return;
-#endif
 
 	for (d = 0; d < 16; d++)
 		P_SpawnParaloop(actor->x, actor->y, actor->z + actor->height, FixedMul(actor->info->painchance, actor->scale), 16, MT_NIGHTSPARKLE, S_NULL, d*(ANGLE_22h), true);
@@ -6571,12 +6444,10 @@ void A_OldRingExplode(mobj_t *actor) {
 	mobj_t *mo;
 	const fixed_t ns = FixedMul(20 * FRACUNIT, actor->scale);
 	INT32 locvar1 = var1;
-	//INT32 locvar2 = var2;
 	boolean changecolor = (actor->target && actor->target->player);
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_OldRingExplode", actor))
 		return;
-#endif
 
 	for (i = 0; i < 32; i++)
 	{
@@ -6650,12 +6521,9 @@ void A_MixUp(mobj_t *actor)
 {
 	boolean teleported[MAXPLAYERS];
 	INT32 i, numplayers = 0, prandom = 0;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_MixUp", actor))
 		return;
-#else
-	(void)actor;
-#endif
 
 	if (!multiplayer)
 		return;
@@ -6896,13 +6764,8 @@ void A_MixUp(mobj_t *actor)
 
 				P_SetThingPosition(players[i].mo);
 
-#ifdef ESLOPE
 				players[i].mo->floorz = P_GetFloorZ(players[i].mo, players[i].mo->subsector->sector, players[i].mo->x, players[i].mo->y, NULL);
 				players[i].mo->ceilingz = P_GetCeilingZ(players[i].mo, players[i].mo->subsector->sector, players[i].mo->x, players[i].mo->y, NULL);
-#else
-				players[i].mo->floorz = players[i].mo->subsector->sector->floorheight;
-				players[i].mo->ceilingz = players[i].mo->subsector->sector->ceilingheight;
-#endif
 
 				P_CheckPosition(players[i].mo, players[i].mo->x, players[i].mo->y);
 			}
@@ -6934,15 +6797,8 @@ void A_RecyclePowers(mobj_t *actor)
 	INT32 weapons[MAXPLAYERS];
 	INT32 weaponheld[MAXPLAYERS];
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_RecyclePowers", actor))
 		return;
-#endif
-
-#if !defined(WEIGHTEDRECYCLER) && !defined(HAVE_BLUA)
-	// actor is used in all scenarios but this one, funny enough
-	(void)actor;
-#endif
 
 	if (!multiplayer)
 	{
@@ -7069,10 +6925,9 @@ void A_RecyclePowers(mobj_t *actor)
 void A_Boss1Chase(mobj_t *actor)
 {
 	INT32 delta;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_Boss1Chase", actor))
 		return;
-#endif
 
 	if (!actor->target || !(actor->target->flags & MF_SHOOTABLE))
 	{
@@ -7193,10 +7048,9 @@ void A_Boss2Chase(mobj_t *actor)
 	fixed_t radius;
 	boolean reverse = false;
 	INT32 speedvar;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_Boss2Chase", actor))
 		return;
-#endif
 
 	if (actor->health <= 0)
 		return;
@@ -7321,10 +7175,9 @@ void A_Boss2Chase(mobj_t *actor)
 //
 void A_Boss2Pogo(mobj_t *actor)
 {
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_Boss2Pogo", actor))
 		return;
-#endif
+
 	if (actor->z <= actor->floorz + FixedMul(8*FRACUNIT, actor->scale) && actor->momz <= 0)
 	{
 		if (actor->state != &states[actor->info->raisestate])
@@ -7369,10 +7222,10 @@ void A_Boss2Pogo(mobj_t *actor)
 void A_Boss2TakeDamage(mobj_t *actor)
 {
 	INT32 locvar1 = var1;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_Boss2TakeDamage", actor))
 		return;
-#endif
+
 	A_Pain(actor);
 	actor->reactiontime = 1; // turn around
 	if (locvar1 == 0) // old A_Invincibilerize behavior
@@ -7392,10 +7245,9 @@ void A_Boss7Chase(mobj_t *actor)
 {
 	INT32 delta;
 	INT32 i;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_Boss7Chase", actor))
 		return;
-#endif
 
 	if (actor->z != actor->floorz)
 		return;
@@ -7524,10 +7376,9 @@ void A_Boss7Chase(mobj_t *actor)
 //
 void A_GoopSplat(mobj_t *actor)
 {
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_GoopSplat", actor))
 		return;
-#endif
+
 	P_UnsetThingPosition(actor);
 	if (sector_list)
 	{
@@ -7549,10 +7400,9 @@ void A_Boss2PogoSFX(mobj_t *actor)
 {
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_Boss2PogoSFX", actor))
 		return;
-#endif
 
 	if (!actor->target || !(actor->target->flags & MF_SHOOTABLE))
 	{
@@ -7593,10 +7443,8 @@ void A_Boss2PogoTarget(mobj_t *actor)
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_Boss2PogoTarget", actor))
 		return;
-#endif
 
 	if (!actor->target || !(actor->target->flags & MF_SHOOTABLE) || (actor->target->player && actor->target->player->powers[pw_flashing])
 	|| P_AproxDistance(actor->x-actor->target->x, actor->y-actor->target->y) >= FixedMul(512*FRACUNIT, actor->scale))
@@ -7680,10 +7528,9 @@ void A_Boss2PogoTarget(mobj_t *actor)
 //
 void A_EggmanBox(mobj_t *actor)
 {
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_EggmanBox", actor))
 		return;
-#endif
+
 	if (!actor->target || !actor->target->player)
 	{
 		CONS_Debug(DBG_GAMELOGIC, "Powerup has no target.\n");
@@ -7706,10 +7553,9 @@ void A_TurretFire(mobj_t *actor)
 	fixed_t dist;
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_TurretFire", actor))
 		return;
-#endif
 
 	if (locvar2)
 		dist = FixedMul(locvar2*FRACUNIT, actor->scale);
@@ -7745,10 +7591,9 @@ void A_SuperTurretFire(mobj_t *actor)
 	fixed_t dist;
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_SuperTurretFire", actor))
 		return;
-#endif
 
 	if (locvar2)
 		dist = FixedMul(locvar2*FRACUNIT, actor->scale);
@@ -7782,10 +7627,9 @@ void A_SuperTurretFire(mobj_t *actor)
 void A_TurretStop(mobj_t *actor)
 {
 	INT32 locvar1 = var1;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_TurretStop", actor))
 		return;
-#endif
 
 	actor->flags2 &= ~MF2_FIRING;
 	actor->flags2 &= ~MF2_SUPERFIRE;
@@ -7803,10 +7647,8 @@ void A_TurretStop(mobj_t *actor)
 //
 void A_SparkFollow(mobj_t *actor)
 {
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_SparkFollow", actor))
 		return;
-#endif
 
 	if ((!actor->target || (actor->target->health <= 0))
 		|| (actor->target->player && !actor->target->player->powers[pw_super]))
@@ -7840,10 +7682,10 @@ void A_BuzzFly(mobj_t *actor)
 {
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_BuzzFly", actor))
 		return;
-#endif
+
 	if (actor->flags2 & MF2_AMBUSH)
 		return;
 
@@ -7939,10 +7781,9 @@ void A_BuzzFly(mobj_t *actor)
 void A_GuardChase(mobj_t *actor)
 {
 	INT32 delta;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_GuardChase", actor))
 		return;
-#endif
 
 	if (actor->reactiontime)
 		actor->reactiontime--;
@@ -8045,10 +7886,9 @@ void A_EggShield(mobj_t *actor)
 	fixed_t newx, newy;
 	fixed_t movex, movey;
 	angle_t angle;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_EggShield", actor))
 		return;
-#endif
 
 	if (!actor->target || !actor->target->health)
 	{
@@ -8129,10 +7969,9 @@ void A_EggShield(mobj_t *actor)
 //
 void A_SetReactionTime(mobj_t *actor)
 {
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_SetReactionTime", actor))
 		return;
-#endif
+
 	if (var1)
 		actor->reactiontime = var2;
 	else
@@ -8152,10 +7991,8 @@ void A_Boss1Spikeballs(mobj_t *actor)
 	INT32 locvar2 = var2;
 	mobj_t *ball;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_Boss1Spikeballs", actor))
 		return;
-#endif
 
 	ball = P_SpawnMobj(actor->x, actor->y, actor->z, MT_EGGMOBILE_BALL);
 	P_SetTarget(&ball->target, actor);
@@ -8176,10 +8013,9 @@ void A_Boss1Spikeballs(mobj_t *actor)
 //
 void A_Boss3TakeDamage(mobj_t *actor)
 {
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_Boss3TakeDamage", actor))
 		return;
-#endif
+
 	actor->movecount = var1;
 	actor->movefactor = -512*FRACUNIT;
 
@@ -8197,10 +8033,8 @@ void A_Boss3TakeDamage(mobj_t *actor)
 //
 void A_Boss3Path(mobj_t *actor)
 {
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_Boss3Path", actor))
 		return;
-#endif
 
 	if (actor->tracer && actor->tracer->health && actor->tracer->movecount)
 		actor->movecount |= 1;
@@ -8326,10 +8160,8 @@ void A_Boss3Path(mobj_t *actor)
 //
 void A_Boss3ShockThink(mobj_t *actor)
 {
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_Boss3ShockThink", actor))
 		return;
-#endif
 
 	if (actor->momx || actor->momy)
 		actor->angle = R_PointToAngle2(0, 0, actor->momx, actor->momy) + ANGLE_90;
@@ -8380,10 +8212,9 @@ void A_LinedefExecute(mobj_t *actor)
 	INT32 tagnum;
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_LinedefExecute", actor))
 		return;
-#endif
 
 	tagnum = locvar1;
 	// state numbers option is no more, custom states cannot be guaranteed to stay the same number anymore, now that they can be defined by names instead
@@ -8408,10 +8239,9 @@ void A_LinedefExecute(mobj_t *actor)
 //
 void A_PlaySeeSound(mobj_t *actor)
 {
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_PlaySeeSound", actor))
 		return;
-#endif
+
 	if (actor->info->seesound)
 		S_StartScreamSound(actor, actor->info->seesound);
 }
@@ -8425,10 +8255,9 @@ void A_PlaySeeSound(mobj_t *actor)
 //
 void A_PlayAttackSound(mobj_t *actor)
 {
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_PlayAttackSound", actor))
 		return;
-#endif
+
 	if (actor->info->attacksound)
 		S_StartAttackSound(actor, actor->info->attacksound);
 }
@@ -8442,10 +8271,9 @@ void A_PlayAttackSound(mobj_t *actor)
 //
 void A_PlayActiveSound(mobj_t *actor)
 {
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_PlayActiveSound", actor))
 		return;
-#endif
+
 	if (actor->info->activesound)
 		S_StartSound(actor, actor->info->activesound);
 }
@@ -8461,10 +8289,9 @@ void A_SmokeTrailer(mobj_t *actor)
 {
 	mobj_t *th;
 	INT32 locvar1 = var1;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_SmokeTrailer", actor))
 		return;
-#endif
 
 	if (leveltime % 4)
 		return;
@@ -8503,10 +8330,9 @@ void A_SpawnObjectAbsolute(mobj_t *actor)
 	mobj_t *mo;
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_SpawnObjectAbsolute", actor))
 		return;
-#endif
 
 	x = (INT16)(locvar1>>16);
 	y = (INT16)(locvar1&65535);
@@ -8540,10 +8366,9 @@ void A_SpawnObjectRelative(mobj_t *actor)
 	mobj_t *mo;
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_SpawnObjectRelative", actor))
 		return;
-#endif
 
 	CONS_Debug(DBG_GAMELOGIC, "A_SpawnObjectRelative called from object type %d, var1: %d, var2: %d\n", actor->type, locvar1, locvar2);
 
@@ -8585,10 +8410,9 @@ void A_ChangeAngleRelative(mobj_t *actor)
 	const fixed_t amax = locvar2*FRACUNIT;
 	//const angle_t amin = FixedAngle(locvar1*FRACUNIT);
 	//const angle_t amax = FixedAngle(locvar2*FRACUNIT);
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_ChangeAngleRelative", actor))
 		return;
-#endif
 
 #ifdef PARANOIA
 	if (amin > amax)
@@ -8619,10 +8443,9 @@ void A_ChangeAngleAbsolute(mobj_t *actor)
 	const fixed_t amax = locvar2*FRACUNIT;
 	//const angle_t amin = FixedAngle(locvar1*FRACUNIT);
 	//const angle_t amax = FixedAngle(locvar2*FRACUNIT);
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_ChangeAngleAbsolute", actor))
 		return;
-#endif
 
 #ifdef PARANOIA
 	if (amin > amax)
@@ -8650,10 +8473,8 @@ void A_RollAngle(mobj_t *actor)
 	INT32 locvar2 = var2;
 	const angle_t angle = FixedAngle(locvar1*FRACUNIT);
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_RollAngle", actor))
 		return;
-#endif
 
 	// relative (default)
 	if (!locvar2)
@@ -8676,10 +8497,9 @@ void A_ChangeRollAngleRelative(mobj_t *actor)
 	INT32 locvar2 = var2;
 	const fixed_t amin = locvar1*FRACUNIT;
 	const fixed_t amax = locvar2*FRACUNIT;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_ChangeRollAngleRelative", actor))
 		return;
-#endif
 
 #ifdef PARANOIA
 	if (amin > amax)
@@ -8702,10 +8522,9 @@ void A_ChangeRollAngleAbsolute(mobj_t *actor)
 	INT32 locvar2 = var2;
 	const fixed_t amin = locvar1*FRACUNIT;
 	const fixed_t amax = locvar2*FRACUNIT;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_ChangeRollAngleAbsolute", actor))
 		return;
-#endif
 
 #ifdef PARANOIA
 	if (amin > amax)
@@ -8728,10 +8547,9 @@ void A_PlaySound(mobj_t *actor)
 {
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_PlaySound", actor))
 		return;
-#endif
 
 	if (leveltime < 2 && (locvar2 >> 16))
 		return;
@@ -8754,10 +8572,9 @@ void A_FindTarget(mobj_t *actor)
 	thinker_t *th;
 	mobj_t *mo2;
 	fixed_t dist1 = 0, dist2 = 0;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_FindTarget", actor))
 		return;
-#endif
 
 	CONS_Debug(DBG_GAMELOGIC, "A_FindTarget called from object type %d, var1: %d, var2: %d\n", actor->type, locvar1, locvar2);
 
@@ -8819,10 +8636,9 @@ void A_FindTracer(mobj_t *actor)
 	thinker_t *th;
 	mobj_t *mo2;
 	fixed_t dist1 = 0, dist2 = 0;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_FindTracer", actor))
 		return;
-#endif
 
 	CONS_Debug(DBG_GAMELOGIC, "A_FindTracer called from object type %d, var1: %d, var2: %d\n", actor->type, locvar1, locvar2);
 
@@ -8880,10 +8696,9 @@ void A_SetTics(mobj_t *actor)
 {
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_SetTics", actor))
 		return;
-#endif
 
 	if (locvar1)
 		actor->tics = locvar1;
@@ -8902,10 +8717,9 @@ void A_SetRandomTics(mobj_t *actor)
 {
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_SetRandomTics", actor))
 		return;
-#endif
 
 	actor->tics = P_RandomRange(locvar1, locvar2);
 }
@@ -8921,10 +8735,9 @@ void A_ChangeColorRelative(mobj_t *actor)
 {
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_ChangeColorRelative", actor))
 		return;
-#endif
 
 	if (locvar1)
 	{
@@ -8947,10 +8760,9 @@ void A_ChangeColorAbsolute(mobj_t *actor)
 {
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_ChangeColorAbsolute", actor))
 		return;
-#endif
 
 	if (locvar1)
 	{
@@ -8972,10 +8784,9 @@ void A_MoveRelative(mobj_t *actor)
 {
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_MoveRelative", actor))
 		return;
-#endif
 
 	P_Thrust(actor, actor->angle+FixedAngle(locvar1*FRACUNIT), FixedMul(locvar2*FRACUNIT, actor->scale));
 }
@@ -8991,10 +8802,9 @@ void A_MoveAbsolute(mobj_t *actor)
 {
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_MoveAbsolute", actor))
 		return;
-#endif
 
 	P_InstaThrust(actor, FixedAngle(locvar1*FRACUNIT), FixedMul(locvar2*FRACUNIT, actor->scale));
 }
@@ -9010,10 +8820,9 @@ void A_Thrust(mobj_t *actor)
 {
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_Thrust", actor))
 		return;
-#endif
 
 	if (!locvar1)
 		CONS_Debug(DBG_GAMELOGIC, "A_Thrust: Var1 not specified!\n");
@@ -9037,10 +8846,9 @@ void A_ZThrust(mobj_t *actor)
 {
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_ZThrust", actor))
 		return;
-#endif
 
 	if (!locvar1)
 		CONS_Debug(DBG_GAMELOGIC, "A_ZThrust: Var1 not specified!\n");
@@ -9072,10 +8880,9 @@ void A_SetTargetsTarget(mobj_t *actor)
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
 	mobj_t *oldtarg = NULL, *newtarg = NULL;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_SetTargetsTarget", actor))
 		return;
-#endif
 
 	// actor's target
 	if (locvar1) // or tracer
@@ -9117,10 +8924,9 @@ void A_SetObjectFlags(mobj_t *actor)
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
 	boolean unlinkthings = false;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_SetObjectFlags", actor))
 		return;
-#endif
 
 	if (locvar2 == 2)
 		locvar1 = actor->flags | locvar1;
@@ -9159,10 +8965,9 @@ void A_SetObjectFlags2(mobj_t *actor)
 {
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_SetObjectFlags2", actor))
 		return;
-#endif
 
 	if (locvar2 == 2)
 		actor->flags2 |= locvar1;
@@ -9187,10 +8992,9 @@ void A_BossJetFume(mobj_t *actor)
 {
 	mobj_t *filler;
 	INT32 locvar1 = var1;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_BossJetFume", actor))
 		return;
-#endif
 
 	if (locvar1 == 0) // Boss1 jet fumes
 	{
@@ -9323,10 +9127,9 @@ void A_RandomState(mobj_t *actor)
 {
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_RandomState", actor))
 		return;
-#endif
 
 	P_SetMobjState(actor, P_RandomChance(FRACUNIT/2) ? locvar1 : locvar2);
 }
@@ -9343,10 +9146,8 @@ void A_RandomStateRange(mobj_t *actor)
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_RandomStateRange", actor))
 		return;
-#endif
 
 	P_SetMobjState(actor, P_RandomRange(locvar1, locvar2));
 }
@@ -9362,27 +9163,22 @@ void A_DualAction(mobj_t *actor)
 {
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_DualAction", actor))
 		return;
-#endif
 
 	CONS_Debug(DBG_GAMELOGIC, "A_DualAction called from object type %d, var1: %d, var2: %d\n", actor->type, locvar1, locvar2);
 
 	var1 = states[locvar1].var1;
 	var2 = states[locvar1].var2;
-#ifdef HAVE_BLUA
 	astate = &states[locvar1];
-#endif
 
 	CONS_Debug(DBG_GAMELOGIC, "A_DualAction: Calling First Action (state %d)...\n", locvar1);
 	states[locvar1].action.acp1(actor);
 
 	var1 = states[locvar2].var1;
 	var2 = states[locvar2].var2;
-#ifdef HAVE_BLUA
 	astate = &states[locvar2];
-#endif
 
 	CONS_Debug(DBG_GAMELOGIC, "A_DualAction: Calling Second Action (state %d)...\n", locvar2);
 	states[locvar2].action.acp1(actor);
@@ -9400,10 +9196,9 @@ void A_RemoteAction(mobj_t *actor)
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
 	mobj_t *originaltarget = actor->target; // Hold on to the target for later.
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_RemoteAction", actor))
 		return;
-#endif
 
 	// If >=0, find the closest target.
 	if (locvar1 >= 0)
@@ -9465,9 +9260,7 @@ void A_RemoteAction(mobj_t *actor)
 		// Steal the var1 and var2 from "locvar2"
 		var1 = states[locvar2].var1;
 		var2 = states[locvar2].var2;
-#ifdef HAVE_BLUA
 		astate = &states[locvar2];
-#endif
 
 		CONS_Debug(DBG_GAMELOGIC, "A_RemoteAction: Calling action on %p\n"
 				"var1 is %d\nvar2 is %d\n", actor->target, var1, var2);
@@ -9486,10 +9279,9 @@ void A_RemoteAction(mobj_t *actor)
 //
 void A_ToggleFlameJet(mobj_t* actor)
 {
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_ToggleFlameJet", actor))
 		return;
-#endif
+
 	// threshold - off delay
 	// movecount - on timer
 
@@ -9533,10 +9325,9 @@ void A_OrbitNights(mobj_t* actor)
 	boolean ishelper = (var2 & 0x10000);
 	boolean donotrescale = (var2 & 0x40000);
 	INT32 xfactor = 32, yfactor = 32, zfactor = 20;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_OrbitNights", actor))
 		return;
-#endif
 
 	if (actor->flags & MF_GRENADEBOUNCE)
 	{
@@ -9607,10 +9398,10 @@ void A_GhostMe(mobj_t *actor)
 {
 	INT32 locvar1 = var1;
 	mobj_t *ghost;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_GhostMe", actor))
 		return;
-#endif
+
 	ghost = P_SpawnGhostMobj(actor);
 	if (ghost && locvar1 > 0)
 		ghost->fuse = locvar1;
@@ -9630,10 +9421,9 @@ void A_SetObjectState(mobj_t *actor)
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
 	mobj_t *target;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_SetObjectState", actor))
 		return;
-#endif
 
 	if ((!locvar2 && !actor->target) || (locvar2 && !actor->tracer))
 	{
@@ -9676,10 +9466,8 @@ void A_SetObjectTypeState(mobj_t *actor)
 	mobj_t *mo2;
 	fixed_t dist = 0;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_SetObjectTypeState", actor))
 		return;
-#endif
 
 	for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next)
 	{
@@ -9719,10 +9507,9 @@ void A_KnockBack(mobj_t *actor)
 {
 	INT32 locvar1 = var1;
 	mobj_t *target;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_KnockBack", actor))
 		return;
-#endif
 
 	if (!locvar1)
 		target = actor->target;
@@ -9755,10 +9542,9 @@ void A_PushAway(mobj_t *actor)
 	INT32 locvar2 = var2;
 	mobj_t *target; // target
 	angle_t an; // actor to target angle
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_PushAway", actor))
 		return;
-#endif
 
 	if ((!(locvar2 >> 16) && !actor->target) || ((locvar2 >> 16) && !actor->tracer))
 		return;
@@ -9790,10 +9576,9 @@ void A_RingDrain(mobj_t *actor)
 {
 	INT32 locvar1 = var1;
 	player_t *player;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_RingDrain", actor))
 		return;
-#endif
 
 	if (!actor->target || !actor->target->player)
 	{
@@ -9823,10 +9608,9 @@ void A_SplitShot(mobj_t *actor)
 	const UINT16 loc2up = (UINT16)(locvar2 >> 16);
 	const fixed_t offs = (fixed_t)(locvar1*FRACUNIT);
 	const fixed_t hoffs = (fixed_t)(loc2up*FRACUNIT);
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_SplitShot", actor))
 		return;
-#endif
 
 	A_FaceTarget(actor);
 	{
@@ -9858,10 +9642,10 @@ void A_MissileSplit(mobj_t *actor)
 {
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_MissileSplit", actor))
 		return;
-#endif
+
 	if (actor->eflags & MFE_VERTICALFLIP)
 		P_SpawnAlteredDirectionMissile(actor, locvar1, actor->x, actor->y, actor->z+actor->height, locvar2);
 	else
@@ -9886,10 +9670,9 @@ void A_MultiShot(mobj_t *actor)
 	const UINT16 loc1up = (UINT16)(locvar1 >> 16);
 	INT32 count = 0;
 	fixed_t ad;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_MultiShot", actor))
 		return;
-#endif
 
 	if (actor->target)
 		A_FaceTarget(actor);
@@ -9948,10 +9731,9 @@ void A_InstaLoop(mobj_t *actor)
 	const angle_t fa = FixedAngleC(loc1lw*FRACUNIT*360, loc1up*FRACUNIT)>>ANGLETOFINESHIFT;
 	const fixed_t ac = FINECOSINE(fa);
 	const fixed_t as = FINESINE(fa);
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_InstaLoop", actor))
 		return;
-#endif
 
 	P_InstaThrust(actor, actor->angle, FixedMul(ac, FixedMul(force, actor->scale)));
 	P_SetObjectMomZ(actor, FixedMul(as, force), false);
@@ -9982,10 +9764,9 @@ void A_Custom3DRotate(mobj_t *actor)
 	const fixed_t hOff = FixedMul(loc1up*FRACUNIT, actor->scale);
 	const fixed_t hspeed = FixedMul(loc2up*FRACUNIT/10, actor->scale);
 	const fixed_t vspeed = FixedMul(loc2lw*FRACUNIT/10, actor->scale);
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_Custom3DRotate", actor))
 		return;
-#endif
 
 	if (actor->target->health == 0)
 	{
@@ -10042,10 +9823,9 @@ void A_SearchForPlayers(mobj_t *actor)
 {
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_SearchForPlayers", actor))
 		return;
-#endif
 
 	if (!actor->target || !(actor->target->flags & MF_SHOOTABLE))
 	{
@@ -10076,10 +9856,9 @@ void A_CheckRandom(mobj_t *actor)
 	INT32 locvar2 = var2;
 	fixed_t chance = FRACUNIT;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_CheckRandom", actor))
 		return;
-#endif
+
 	if ((locvar1 & 0xFFFF) == 0)
 		return;
 
@@ -10103,10 +9882,9 @@ void A_CheckTargetRings(mobj_t *actor)
 {
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_CheckTargetRings", actor))
 		return;
-#endif
 
 	if (!(actor->target) || !(actor->target->player))
 	   return;
@@ -10127,10 +9905,9 @@ void A_CheckRings(mobj_t *actor)
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
 	INT32 i, cntr = 0;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_CheckRings", actor))
 		return;
-#endif
 
 	for (i = 0; i < MAXPLAYERS; i++)
 		cntr += players[i].rings;
@@ -10152,10 +9929,9 @@ void A_CheckTotalRings(mobj_t *actor)
 	INT32 locvar2 = var2;
 
 	INT32 i, cntr = 0;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_CheckTotalRings", actor))
 		return;
-#endif
 
 	for (i = 0; i < MAXPLAYERS; i++)
 		cntr += players[i].totalring;
@@ -10175,10 +9951,9 @@ void A_CheckHealth(mobj_t *actor)
 {
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_CheckHealth", actor))
 		return;
-#endif
 
 	if (actor->health <= locvar1)
 		P_SetMobjState(actor, locvar2);
@@ -10198,10 +9973,9 @@ void A_CheckRange(mobj_t *actor)
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
 	fixed_t dist;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_CheckRange", actor))
 		return;
-#endif
 
 	if ((!(locvar1 >> 16) && !actor->target) || ((locvar1 >> 16) && !actor->tracer))
 		return;
@@ -10229,10 +10003,9 @@ void A_CheckHeight(mobj_t *actor)
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
 	fixed_t height;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_CheckHeight", actor))
 		return;
-#endif
 
 	if ((!(locvar1 >> 16) && !actor->target) || ((locvar1 >> 16) && !actor->tracer))
 		return;
@@ -10262,10 +10035,9 @@ void A_CheckTrueRange(mobj_t *actor)
 	fixed_t height; // vertical range
 	fixed_t dist; // horizontal range
 	fixed_t l; // true range
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_CheckTrueRange", actor))
 		return;
-#endif
 
 	if ((!(locvar1 >> 16) && !actor->target) || ((locvar1 >> 16) && !actor->tracer))
 		return;
@@ -10314,10 +10086,9 @@ void A_CheckThingCount(mobj_t *actor)
 	thinker_t *th;
 	mobj_t *mo2;
 	fixed_t dist = 0;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_CheckThingCount", actor))
 		return;
-#endif
 
 	for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next)
 	{
@@ -10361,10 +10132,8 @@ void A_CheckAmbush(mobj_t *actor)
 	angle_t atp; // actor to target angle
 	angle_t an; // angle between at and atp
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_CheckAmbush", actor))
 		return;
-#endif
 
 	if ((!locvar1 && !actor->target) || (locvar1 && !actor->tracer))
 		return;
@@ -10400,10 +10169,9 @@ void A_CheckCustomValue(mobj_t *actor)
 {
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_CheckCustomValue", actor))
 		return;
-#endif
 
 	if (actor->cusval >= locvar1)
 		P_SetMobjState(actor, locvar2);
@@ -10420,10 +10188,9 @@ void A_CheckCusValMemo(mobj_t *actor)
 {
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_CheckCusValMemo", actor))
 		return;
-#endif
 
 	if (actor->cvmem >= locvar1)
 		P_SetMobjState(actor, locvar2);
@@ -10446,10 +10213,9 @@ void A_SetCustomValue(mobj_t *actor)
 {
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_SetCustomValue", actor))
 		return;
-#endif
 
 	if (cv_debug)
 		CONS_Printf("Init custom value is %d\n", actor->cusval);
@@ -10497,10 +10263,9 @@ void A_UseCusValMemo(mobj_t *actor)
 
 	INT32 temp = actor->cusval; // value being manipulated
 	INT32 tempM = actor->cvmem; // value used to manipulate temp with
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_UseCusValMemo", actor))
 		return;
-#endif
 
 	if (locvar1 == 1) // cvmem being changed using cusval
 	{
@@ -10561,10 +10326,9 @@ void A_RelayCustomValue(mobj_t *actor)
 
 	INT32 temp; // reference value - var1 lower 16 bits changes this
 	INT32 tempT; // target's value - changed to tracer if var1 upper 16 bits set, then modified to become final value
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_RelayCustomValue", actor))
 		return;
-#endif
 
 	if ((!(locvar1 >> 16) && !actor->target) || ((locvar1 >> 16) && !actor->tracer))
 		return;
@@ -10621,10 +10385,9 @@ void A_CusValAction(mobj_t *actor)
 {
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_CusValAction", actor))
 		return;
-#endif
 
 	if (locvar2 == 5)
 	{
@@ -10657,9 +10420,7 @@ void A_CusValAction(mobj_t *actor)
 		var2 = states[locvar1].var2;
 	}
 
-#ifdef HAVE_BLUA
 	astate = &states[locvar1];
-#endif
 	states[locvar1].action.acp1(actor);
 }
 
@@ -10675,10 +10436,9 @@ void A_CusValAction(mobj_t *actor)
 void A_ForceStop(mobj_t *actor)
 {
 	INT32 locvar1 = var1;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_ForceStop", actor))
 		return;
-#endif
 
 	actor->momx = actor->momy = 0;
 	if (locvar1 == 0)
@@ -10696,12 +10456,8 @@ void A_ForceWin(mobj_t *actor)
 {
 	INT32 i;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_ForceWin", actor))
 		return;
-#else
-	(void)actor;
-#endif
 
 	for (i = 0; i < MAXPLAYERS; i++)
 	{
@@ -10733,10 +10489,9 @@ void A_ForceWin(mobj_t *actor)
 void A_SpikeRetract(mobj_t *actor)
 {
 	INT32 locvar1 = var1;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_SpikeRetract", actor))
 		return;
-#endif
 
 	if (actor->flags & MF_NOBLOCKMAP)
 		return;
@@ -10818,10 +10573,9 @@ void A_Repeat(mobj_t *actor)
 {
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_Repeat", actor))
 		return;
-#endif
 
 	if (locvar1 && (!actor->extravalue2 || actor->extravalue2 > locvar1))
 		actor->extravalue2 = locvar1;
@@ -10844,10 +10598,9 @@ void A_SetScale(mobj_t *actor)
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
 	mobj_t *target;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_SetScale", actor))
 		return;
-#endif
 
 	if (locvar1 <= 0)
 	{
@@ -10888,10 +10641,10 @@ void A_RemoteDamage(mobj_t *actor)
 	INT32 locvar2 = var2;
 	mobj_t *target; // we MUST have a target
 	mobj_t *source = NULL; // on the other hand we don't necessarily need a source
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_RemoteDamage", actor))
 		return;
-#endif
+
 	if (locvar1 == 1)
 		target = actor->target;
 	else if (locvar1 == 2)
@@ -10941,10 +10694,9 @@ void A_HomingChase(mobj_t *actor)
 	mobj_t *dest;
 	fixed_t dist;
 	fixed_t speedmul;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_HomingChase", actor))
 		return;
-#endif
 
 	if (locvar2 == 1)
 		dest = actor->tracer;
@@ -10995,10 +10747,9 @@ void A_TrapShot(mobj_t *actor)
 	INT16 vertoff = (INT16)(locvar2 >> 16);
 	fixed_t x, y, z;
 	fixed_t speed;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_TrapShot", actor))
 		return;
-#endif
 
 	x = actor->x + P_ReturnThrustX(actor, actor->angle, FixedMul(frontoff*FRACUNIT, actor->scale));
 	y = actor->y + P_ReturnThrustY(actor, actor->angle, FixedMul(frontoff*FRACUNIT, actor->scale));
@@ -11062,10 +10813,8 @@ void A_VileTarget(mobj_t *actor)
 	mobjtype_t fogtype;
 	INT32 i;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_VileTarget", actor))
 		return;
-#endif
 
 	if (!actor->target)
 		return;
@@ -11151,10 +10900,8 @@ void A_VileAttack(mobj_t *actor)
 	mobj_t *fire;
 	INT32 i;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_VileAttack", actor))
 		return;
-#endif
 
 	if (!actor->target)
 		return;
@@ -11265,10 +11012,8 @@ void A_VileFire(mobj_t *actor)
 	INT32 locvar2 = var2;
 	mobj_t *dest;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_VileFire", actor))
 		return;
-#endif
 
 	dest = actor->tracer;
 	if (!dest)
@@ -11353,10 +11098,8 @@ void A_BrakChase(mobj_t *actor)
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_BrakChase", actor))
 		return;
-#endif
 
 	// Set new tics NOW, in case the state changes while we're doing this and we try applying this to the painstate or something silly
 	if (actor->tics > 1 && locvar1 < actor->tics) // Not much point, otherwise
@@ -11475,10 +11218,9 @@ void A_BrakFireShot(mobj_t *actor)
 	fixed_t x, y, z;
 	INT32 locvar1 = var1;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_BrakFireShot", actor))
 		return;
-#endif
+
 	if (!actor->target)
 		return;
 
@@ -11539,10 +11281,8 @@ void A_BrakLobShot(mobj_t *actor)
 	INT32 locvar2 = var2 & 0x0000FFFF;
 	INT32 aimDirect = var2 & 0xFFFF0000;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_BrakLobShot", actor))
 		return;
-#endif
 
 	if (!actor->target)
 		return; // Don't even bother if we've got nothing to aim at.
@@ -11647,10 +11387,8 @@ void A_NapalmScatter(mobj_t *actor)
 	INT32 i; // for-loop cursor
 	mobj_t *mo; // each and every spawned napalm burst
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_NapalmScatter", actor))
 		return;
-#endif
 
 	// Some quick sanity-checking
 	if (typeOfShot >= NUMMOBJTYPES) // I'd add a <0 check, too, but 0x0000FFFF isn't negative in this case
@@ -11701,10 +11439,8 @@ void A_SpawnFreshCopy(mobj_t *actor)
 {
 	mobj_t *newObject;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_SpawnFreshCopy", actor))
 		return;
-#endif
 
 	newObject = P_SpawnMobjFromMobj(actor, 0, 0, 0, actor->type);
 	newObject->flags2 = actor->flags2 & MF2_AMBUSH;
@@ -11778,10 +11514,9 @@ void A_FlickySpawn(mobj_t *actor)
 	INT32 locvar2 = var2;
 	INT32 test = (var1 >> 16);
 	SINT8 moveforward = 0;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_FlickySpawn", actor))
 		return;
-#endif
 
 	if (test & 1)
 		A_Scream(actor); // A shortcut for the truly lazy.
@@ -11847,10 +11582,9 @@ void A_FlickyCenter(mobj_t *actor)
 	UINT16 flickytype = (locvar1 & 0xFFFF);
 	UINT8 flickycolor = ((locvar1 >> 16) & 0xFF);
 	UINT8 flickyflags = ((locvar1 >> 20) & 0xF);
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_FlickyCenter", actor))
 		return;
-#endif
 
 	if (!actor->tracer)
 	{
@@ -11969,10 +11703,8 @@ void A_FlickyAim(mobj_t *actor)
 	INT32 locvar2 = var2;
 	boolean flickyhitwall = false;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_FlickyAim", actor))
 		return;
-#endif
 
 	if ((actor->momx == actor->momy && actor->momy == 0)
 		|| (actor->target && P_IsFlickyCenter(actor->target->type)
@@ -12070,10 +11802,10 @@ void A_FlickyFly(mobj_t *actor)
 {
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_FlickyFly", actor))
 		return;
-#endif
+
 	P_InternalFlickyFly(actor, locvar1, locvar2,
 	FINECOSINE((((actor->fuse % 36) * ANG10) >> ANGLETOFINESHIFT) & FINEMASK)
 	);
@@ -12090,10 +11822,10 @@ void A_FlickySoar(mobj_t *actor)
 {
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_FlickySoar", actor))
 		return;
-#endif
+
 	P_InternalFlickyFly(actor, locvar1, locvar2,
 	2*(FRACUNIT/2 - abs(FINECOSINE((((actor->fuse % 144) * 5*ANG1/2) >> ANGLETOFINESHIFT) & FINEMASK)))
 	);
@@ -12114,10 +11846,10 @@ void A_FlickyCoast(mobj_t *actor)
 {
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_FlickyCoast", actor))
 		return;
-#endif
+
 	if (actor->eflags & MFE_UNDERWATER)
 	{
 		actor->momx = (11*actor->momx)/12;
@@ -12161,10 +11893,10 @@ void A_FlickyHop(mobj_t *actor)
 {
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_FlickyHop", actor))
 		return;
-#endif
+
 	P_InternalFlickyHop(actor, locvar1, locvar2, actor->angle);
 }
 
@@ -12180,10 +11912,10 @@ void A_FlickyFlounder(mobj_t *actor)
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
 	angle_t hopangle;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_FlickyFlounder", actor))
 		return;
-#endif
+
 	locvar1 *= (P_RandomKey(2) + 1);
 	locvar2 *= (P_RandomKey(2) + 1);
 	hopangle = (actor->angle + (P_RandomKey(9) - 4)*ANG2);
@@ -12202,10 +11934,10 @@ void A_FlickyCheck(mobj_t *actor)
 {
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_FlickyCheck", actor))
 		return;
-#endif
+
 	if (actor->target
 		&& P_IsFlickyCenter(actor->target->type)
 		&& (actor->target->flags & MF_GRENADEBOUNCE))
@@ -12239,10 +11971,10 @@ void A_FlickyHeightCheck(mobj_t *actor)
 {
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_FlickyHeightCheck", actor))
 		return;
-#endif
+
 	if (actor->target
 		&& P_IsFlickyCenter(actor->target->type)
 		&& (actor->target->flags & MF_GRENADEBOUNCE))
@@ -12274,10 +12006,10 @@ void A_FlickyFlutter(mobj_t *actor)
 {
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_FlickyFlutter", actor))
 		return;
-#endif
+
 	var1 = locvar1;
 	var2 = locvar2;
 	A_FlickyCheck(actor);
@@ -12305,13 +12037,9 @@ void A_FlameParticle(mobj_t *actor)
 	mobjtype_t type = (mobjtype_t)(mobjinfo[actor->type].painchance);
 	fixed_t rad, hei;
 	mobj_t *particle;
-	//INT32 locvar1 = var1;
-	//INT32 locvar2 = var2;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_FlameParticle", actor))
 		return;
-#endif
 
 	if (!type)
 		return;
@@ -12337,12 +12065,9 @@ void A_FadeOverlay(mobj_t *actor)
 {
 	mobj_t *fade;
 	INT32 locvar1 = var1;
-	//INT32 locvar2 = var2;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_FadeOverlay", actor))
 		return;
-#endif
 
 	fade = P_SpawnGhostMobj(actor);
 	fade->frame = actor->frame;
@@ -12382,10 +12107,8 @@ void A_Boss5Jump(mobj_t *actor)
 	// INT32 locvar1 = var1;
 	// INT32 locvar2 = var2;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_Boss5Jump", actor))
 		return;
-#endif
 
 	if (!actor->tracer)
 		return; // Don't even bother if we've got nothing to aim at.
@@ -12461,10 +12184,8 @@ void A_LightBeamReset(mobj_t *actor)
 	// INT32 locvar1 = var1;
 	// INT32 locvar2 = var2;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_LightBeamReset", actor))
 		return;
-#endif
 
 	actor->destscale = FRACUNIT + P_SignedRandom()*FRACUNIT/256;
 	P_SetScale(actor, actor->destscale);
@@ -12493,10 +12214,8 @@ void A_MineExplode(mobj_t *actor)
 	// INT32 locvar1 = var1;
 	// INT32 locvar2 = var2;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_MineExplode", actor))
 		return;
-#endif
 
 	A_Scream(actor);
 	actor->flags = MF_NOGRAVITY|MF_NOCLIP;
@@ -12548,10 +12267,8 @@ void A_MineRange(mobj_t *actor)
 	INT32 locvar1 = var1;
 	// INT32 locvar2 = var2;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_MineRange", actor))
 		return;
-#endif
 
 	if (!actor->target)
 		return;
@@ -12576,10 +12293,8 @@ void A_ConnectToGround(mobj_t *actor)
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_ConnectToGround", actor))
 		return;
-#endif
 
 	if (actor->subsector->sector->ffloors)
 		P_AdjustMobjFloorZ_FFloors(actor, actor->subsector->sector, 2);
@@ -12636,10 +12351,10 @@ void A_SpawnParticleRelative(mobj_t *actor)
 	mobj_t *mo;
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_SpawnParticleRelative", actor))
 		return;
-#endif
+
 
 	CONS_Debug(DBG_GAMELOGIC, "A_SpawnParticleRelative called from object type %d, var1: %d, var2: %d\n", actor->type, locvar1, locvar2);
 
@@ -12674,10 +12389,9 @@ void A_MultiShotDist(mobj_t *actor)
 {
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_MultiShotDist", actor))
 		return;
-#endif
 
 	{
 		UINT8 i;
@@ -12714,10 +12428,9 @@ void A_WhoCaresIfYourSonIsABee(mobj_t *actor)
 	fixed_t foffsetx;
 	fixed_t foffsety;
 	mobj_t *son;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_WhoCaresIfYourSonIsABee", actor))
 		return;
-#endif
 
 	A_FaceTarget(actor);
 
@@ -12749,11 +12462,9 @@ void A_WhoCaresIfYourSonIsABee(mobj_t *actor)
 void A_ParentTriesToSleep(mobj_t *actor)
 {
 	INT32 locvar1 = var1;
-	//INT32 locvar2 = var2;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_ParentTriesToSleep", actor))
 		return;
-#endif
 
 	if (actor->extravalue1)
 	{
@@ -12780,12 +12491,8 @@ void A_ParentTriesToSleep(mobj_t *actor)
 //
 void A_CryingToMomma(mobj_t *actor)
 {
-	//INT32 locvar1 = var1;
-	//INT32 locvar2 = var2;
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_CryingToMomma", actor))
 		return;
-#endif
 
 	if (actor->tracer)
 		actor->tracer->extravalue1++;
@@ -12813,10 +12520,9 @@ void A_CheckFlags2(mobj_t *actor)
 {
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_CheckFlags2", actor))
 		return;
-#endif
 
 	if (actor->flags2 & locvar1)
 		P_SetMobjState(actor, (statenum_t)locvar2);
@@ -12832,14 +12538,12 @@ void A_CheckFlags2(mobj_t *actor)
 void A_Boss5FindWaypoint(mobj_t *actor)
 {
 	INT32 locvar1 = var1;
-	//INT32 locvar2 = var2;
 	boolean avoidcenter;
 	UINT32 i;
 	UINT8 extrainfo = (actor->spawnpoint ? actor->spawnpoint->extrainfo : 0);
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_Boss5FindWaypoint", actor))
 		return;
-#endif
 
 	avoidcenter = !actor->tracer || (actor->health == actor->info->damage+1);
 
@@ -13054,10 +12758,9 @@ void A_DoNPCSkid(mobj_t *actor)
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
 	fixed_t x, y, z;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_DoNPCSkid", actor))
 		return;
-#endif
 
 	x = actor->x;
 	y = actor->y;
@@ -13111,10 +12814,9 @@ void A_DoNPCPain(mobj_t *actor)
 	INT32 locvar2 = var2;
 	fixed_t vspeed = 0;
 	fixed_t hspeed = FixedMul(4*FRACUNIT, actor->scale);
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_DoNPCPain", actor))
 		return;
-#endif
 
 	actor->flags &= ~(MF_NOGRAVITY|MF_NOCLIP|MF_NOCLIPHEIGHT);
 
@@ -13160,11 +12862,9 @@ void A_DoNPCPain(mobj_t *actor)
 void A_PrepareRepeat(mobj_t *actor)
 {
 	INT32 locvar1 = var1;
-	//INT32 locvar2 = var2;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_PrepareRepeat", actor))
 		return;
-#endif
 
 	actor->extravalue2 = locvar1;
 }
@@ -13183,10 +12883,9 @@ void A_Boss5ExtraRepeat(mobj_t *actor)
 	INT32 calc;
 	INT32 locspawn;
 	INT32 lochealth;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_Boss5ExtraRepeat", actor))
 		return;
-#endif
 
 	if (actor->extravalue2 > 0 && !(actor->flags2 & MF2_FRET))
 		return;
@@ -13217,10 +12916,9 @@ void A_Boss5ExtraRepeat(mobj_t *actor)
 //
 void A_Boss5Calm(mobj_t *actor)
 {
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_Boss5Calm", actor))
 		return;
-#endif
+
 	actor->flags |= MF_SHOOTABLE;
 	actor->flags2 &= ~MF2_FRET;
 }
@@ -13236,10 +12934,9 @@ void A_Boss5CheckOnGround(mobj_t *actor)
 {
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_Boss5CheckOnGround", actor))
 		return;
-#endif
 
 	if ((!(actor->eflags & MFE_VERTICALFLIP) && actor->z <= actor->floorz)
 	|| (actor->eflags & MFE_VERTICALFLIP && actor->z + actor->height >= actor->ceilingz))
@@ -13268,10 +12965,9 @@ void A_Boss5CheckFalling(mobj_t *actor)
 {
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_Boss5CheckFalling", actor))
 		return;
-#endif
 
 	if (actor->health && actor->extravalue2 > 1)
 	{
@@ -13298,10 +12994,9 @@ void A_Boss5PinchShot(mobj_t *actor)
 	INT32 locvar2 = var2;
 	fixed_t zoffset;
 	mobj_t *missile;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_Boss5PinchShot", actor))
 		return;
-#endif
 
 	if (actor->health > actor->info->damage)
 		return;
@@ -13334,10 +13029,9 @@ void A_Boss5MakeItRain(mobj_t *actor)
 	INT32 locvar2 = var2;
 	INT32 offset = (48 + locvar2)<<16; // upper 16 bits, not fixed_t!
 	INT32 i;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_Boss5MakeItRain", actor))
 		return;
-#endif
 
 	actor->flags2 |= MF2_STRONGBOX;
 
@@ -13371,10 +13065,9 @@ void A_Boss5MakeJunk(mobj_t *actor)
 	mobj_t *broked = NULL;
 	angle_t ang;
 	INT32 i = ((locvar2 & 1) ? 8 : 1);
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_Boss5MakeJunk", actor))
 		return;
-#endif
 
 	if (locvar1 < 0 && (actor->flags2 & MF2_SLIDEPUSH)) // this entire action is a hack, don't judge me
 	{
@@ -13462,11 +13155,9 @@ void A_Boss5MakeJunk(mobj_t *actor)
 void A_LookForBetter(mobj_t *actor)
 {
 	INT32 locvar1 = var1;
-	//INT32 locvar2 = var2;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_LookForBetter", actor))
 		return;
-#endif
 
 	P_LookForPlayers(actor, (locvar1 & 65535), false, FixedMul((locvar1 >> 16)*FRACUNIT, actor->scale));
 	A_FaceTarget(actor);
@@ -13524,11 +13215,9 @@ static void P_DustRing(mobjtype_t mobjtype, UINT32 div, fixed_t x, fixed_t y, fi
 void A_Boss5BombExplode(mobj_t *actor)
 {
 	INT32 locvar1 = var1;
-	//INT32 locvar2 = var2;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_Boss5BombExplode", actor))
 		return;
-#endif
 
 	// The original Lua script did not use |= to add flags but just set these flags exactly apparently?
 	// (I may modify this later)
@@ -13631,10 +13320,8 @@ void A_DustDevilThink(mobj_t *actor)
 	INT32 bx, by, xl, xh, yl, yh;
 	fixed_t radius = actor->radius;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_DustDevilThink", actor))
 		return;
-#endif
 
 	//Chained thinker for the spiralling dust column.
 	while (layer && !P_MobjWasRemoved(layer)) {
@@ -13771,15 +13458,12 @@ static boolean PIT_TNTExplode(mobj_t *nearby)
 void A_TNTExplode(mobj_t *actor)
 {
 	INT32 locvar1 = var1;
-	//INT32 locvar2 = var2;
 	INT32 x, y;
 	INT32 xl, xh, yl, yh;
 	static mappoint_t epicenter = {0,0,0};
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_TNTExplode", actor))
 		return;
-#endif
 
 	if (actor->tracer)
 	{
@@ -13843,12 +13527,9 @@ void A_TNTExplode(mobj_t *actor)
 void A_DebrisRandom(mobj_t *actor)
 {
 	INT32 locvar1 = var1;
-	//INT32 locvar2 = var2;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_DebrisRandom", actor))
 		return;
-#endif
 
 	actor->frame |= P_RandomRange(0, locvar1);
 	var1 = 0;
@@ -13888,10 +13569,8 @@ void A_TrainCameo(mobj_t *actor)
 	fixed_t span = locvar1*FRACUNIT;
 	fixed_t len = locvar2*FRACUNIT;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_TrainCameo", actor))
 		return;
-#endif
 
 	//Spawn sides.
 	P_TrainSeg(actor, x, y + span, z, ang, spr, 0);
@@ -13928,10 +13607,8 @@ void A_TrainCameo2(mobj_t *actor)
 	fixed_t span = locvar1*FRACUNIT;
 	fixed_t len = locvar2*FRACUNIT;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_TrainCameo2", actor))
 		return;
-#endif
 
 	//Spawn sides.
 	P_TrainSeg(actor, x, y + span, z, ang, spr, 0);
@@ -13956,10 +13633,8 @@ void A_CanarivoreGas(mobj_t *actor)
 {
 	INT32 locvar1 = var1;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_CanarivoreGas", actor))
 		return;
-#endif
 
 	P_DustRing(locvar1, 4, actor->x, actor->y, actor->z + actor->height / 5, 18, 0, FRACUNIT/10, actor->scale);
 	P_DustRing(locvar1, 6, actor->x, actor->y, actor->z + actor->height / 5, 28, FRACUNIT, FRACUNIT/10, actor->scale);
@@ -13979,10 +13654,8 @@ void A_KillSegments(mobj_t *actor)
 	mobj_t *seg = actor->tracer;
 	INT32 fuse = locvar1 ? locvar1 : TICRATE/2;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_KillSegments", actor))
 		return;
-#endif
 
 	while (seg)
 	{
@@ -14064,10 +13737,8 @@ void A_SnapperSpawn(mobj_t *actor)
 	INT32 i;
 	mobj_t *seg;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_SnapperSpawn", actor))
 		return;
-#endif
 
 	// It spawns 1 head.
 	seg = P_SpawnMobjFromMobj(actor, 0, 0, 0, headtype);
@@ -14116,10 +13787,8 @@ void A_SnapperThinker(mobj_t *actor)
 	fixed_t dist;
 	boolean chasing;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_SnapperThinker", actor))
 		return;
-#endif
 
 	// We make a check just in case there's no spawnpoint.
 	if (actor->spawnpoint)
@@ -14239,10 +13908,8 @@ void A_SaloonDoorSpawn(mobj_t *actor)
 	mobj_t *door;
 	mobjflag2_t ambush = (actor->flags2 & MF2_AMBUSH);
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_SaloonDoorSpawn", actor))
 		return;
-#endif
 
 	if (!locvar1)
 		return;
@@ -14278,10 +13945,8 @@ void A_MinecartSparkThink(mobj_t *actor)
 	fixed_t dz, dm;
 	UINT8 i;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_MinecartSparkThink", actor))
 		return;
-#endif
 
 	if (actor->momz == 0 && P_IsObjectOnGround(actor))
 		actor->momz = P_RandomRange(2, 4)*FRACUNIT;
@@ -14313,10 +13978,9 @@ void A_ModuloToState(mobj_t *actor)
 {
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
-#ifdef HAVE_BLUA
+
 	if (LUA_CallAction("A_ModuloToState", actor))
 		return;
-#endif
 
 	if ((modulothing % locvar1 == 0))
 		P_SetMobjState(actor, (locvar2));
@@ -14334,10 +13998,8 @@ void A_LavafallRocks(mobj_t *actor)
 {
 	UINT8 i;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_LavafallRocks", actor))
 		return;
-#endif
 
 	// Don't spawn rocks unless a player is relatively close by.
 	for (i = 0; i < MAXPLAYERS; ++i)
@@ -14367,10 +14029,8 @@ void A_LavafallLava(mobj_t *actor)
 	mobj_t *lavafall;
 	UINT8 i;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_LavafallLava", actor))
 		return;
-#endif
 
 	if ((40 - actor->fuse) % (2*(actor->scale >> FRACBITS)))
 		return;
@@ -14397,10 +14057,8 @@ void A_LavafallLava(mobj_t *actor)
 //
 void A_FallingLavaCheck(mobj_t *actor)
 {
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_FallingLavaCheck", actor))
 		return;
-#endif
 
 	if (actor->eflags & MFE_TOUCHWATER || P_IsObjectOnGround(actor))
 	{
@@ -14424,10 +14082,8 @@ void A_FireShrink(mobj_t *actor)
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_FireShrink", actor))
 		return;
-#endif
 
 	actor->destscale = locvar1;
 	actor->scalespeed = FRACUNIT/locvar2;
@@ -14450,10 +14106,8 @@ void A_SpawnPterabytes(mobj_t *actor)
 	UINT8 amount = 1;
 	UINT8 i;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_SpawnPterabytes", actor))
 		return;
-#endif
 
 	if (actor->spawnpoint)
 		amount = actor->spawnpoint->extrainfo + 1;
@@ -14487,10 +14141,8 @@ void A_PterabyteHover(mobj_t *actor)
 {
 	angle_t ang, fa;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_PterabyteHover", actor))
 		return;
-#endif
 
 	P_InstaThrust(actor, actor->angle, actor->info->speed);
 	actor->angle += ANG1;
@@ -14511,10 +14163,8 @@ void A_RolloutSpawn(mobj_t *actor)
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_RolloutSpawn", actor))
 		return;
-#endif
 
 	if (!(actor->target)
 		|| P_MobjWasRemoved(actor->target)
@@ -14549,10 +14199,8 @@ void A_RolloutRock(mobj_t *actor)
 	fixed_t speed = P_AproxDistance(actor->momx, actor->momy), topspeed = FixedMul(actor->info->speed, actor->scale);
 	boolean inwater = actor->eflags & (MFE_TOUCHWATER|MFE_UNDERWATER);
 
-#ifdef HAVE_BLUA
 	if (LUA_CallAction("A_RolloutRock", actor))
 		return;
-#endif
 
 	actor->friction = FRACUNIT; // turns out riding on solids sucks, so let's just make it easier on ourselves
 
@@ -14634,10 +14282,8 @@ void A_DragonbomberSpawn(mobj_t *actor)
 	UINT8 i;
 	mobj_t *mo = actor;
 
-	#ifdef HAVE_BLUA
-		if (LUA_CallAction("A_DragonbomberSpawn", actor))
-			return;
-	#endif
+	if (LUA_CallAction("A_DragonbomberSpawn", actor))
+		return;
 
 	for (i = 0; i < var1; i++) // spawn tail segments
 	{
@@ -14672,10 +14318,8 @@ void A_DragonWing(mobj_t *actor)
 	mobj_t *target = actor->target;
 	fixed_t x, y;
 
-	#ifdef HAVE_BLUA
-		if (LUA_CallAction("A_DragonWing", actor))
-			return;
-	#endif
+	if (LUA_CallAction("A_DragonWing", actor))
+		return;
 
 	if (target == NULL || !target->health)
 	{
@@ -14707,10 +14351,8 @@ void A_DragonSegment(mobj_t *actor)
 	fixed_t ydist;
 	fixed_t zdist;
 
-	#ifdef HAVE_BLUA
-		if (LUA_CallAction("A_DragonSegment", actor))
-			return;
-	#endif
+	if (LUA_CallAction("A_DragonSegment", actor))
+		return;
 
 	if (target == NULL || !target->health)
 	{
diff --git a/src/p_floor.c b/src/p_floor.c
index 9c5ab9057f07b831fa94f3936df50b348cf82ac8..b8b40df3c1eb82f1ea3ef5c9f93de34b804afed0 100644
--- a/src/p_floor.c
+++ b/src/p_floor.c
@@ -15,9 +15,7 @@
 #include "doomstat.h"
 #include "m_random.h"
 #include "p_local.h"
-#ifdef ESLOPE
 #include "p_slopes.h"
-#endif
 #include "r_state.h"
 #include "s_sound.h"
 #include "z_zone.h"
@@ -3178,12 +3176,10 @@ void EV_CrumbleChain(sector_t *sec, ffloor_t *rover)
 			if (R_PointInSubsector(a, b)->sector == sec)
 			{
 				mobj_t *spawned = NULL;
-#ifdef ESLOPE
 				if (*rover->t_slope)
 					topz = P_GetZAt(*rover->t_slope, a, b) - (spacing>>1);
 				if (*rover->b_slope)
 					bottomz = P_GetZAt(*rover->b_slope, a, b);
-#endif
 
 				for (c = topz; c > bottomz; c -= spacing)
 				{
diff --git a/src/p_inter.c b/src/p_inter.c
index 95f8fba410479127dadb78e4777d07ea6fd6533f..67d197375bfe46f393533d9c1e43b1dbef744166 100644
--- a/src/p_inter.c
+++ b/src/p_inter.c
@@ -365,10 +365,8 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
 	if (special->flags & (MF_ENEMY|MF_BOSS) && special->flags2 & MF2_FRET)
 		return;
 
-#ifdef HAVE_BLUA
 	if (LUAh_TouchSpecial(special, toucher) || P_MobjWasRemoved(special))
 		return;
-#endif
 
 	// 0 = none, 1 = elemental pierce, 2 = bubble bounce
 	elementalpierce = (((player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL || (player->powers[pw_shield] & SH_NOSTACK) == SH_BUBBLEWRAP) && (player->pflags & PF_SHIELDABILITY)
@@ -1919,10 +1917,8 @@ static void P_HitDeathMessages(player_t *player, mobj_t *inflictor, mobj_t *sour
 	if (!netgame)
 		return; // Presumably it's obvious what's happening in splitscreen.
 
-#ifdef HAVE_BLUA
 	if (LUAh_HurtMsg(player, inflictor, source, damagetype))
 		return;
-#endif
 
 	deadtarget = (player->mo->health <= 0);
 
@@ -2395,10 +2391,8 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget
 	target->flags2 &= ~(MF2_SKULLFLY|MF2_NIGHTSPULL);
 	target->health = 0; // This makes it easy to check if something's dead elsewhere.
 
-#ifdef HAVE_BLUA
 	if (LUAh_MobjDeath(target, inflictor, source, damagetype) || P_MobjWasRemoved(target))
 		return;
-#endif
 
 	// Let EVERYONE know what happened to a player! 01-29-2002 Tails
 	if (target->player && !target->player->spectator)
@@ -3511,11 +3505,7 @@ void P_SpecialStageDamage(player_t *player, mobj_t *inflictor, mobj_t *source)
 boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 damage, UINT8 damagetype)
 {
 	player_t *player;
-#ifdef HAVE_BLUA
 	boolean force = false;
-#else
-	static const boolean force = false;
-#endif
 
 	if (objectplacing)
 		return false;
@@ -3533,7 +3523,6 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
 			return false;
 	}
 
-#ifdef HAVE_BLUA
 	// Everything above here can't be forced.
 	if (!metalrecording)
 	{
@@ -3545,7 +3534,6 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
 		else if (shouldForce == 2)
 			return false;
 	}
-#endif
 
 	if (!force)
 	{
@@ -3579,10 +3567,8 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
 		if (!force && target->flags2 & MF2_FRET) // Currently flashing from being hit
 			return false;
 
-#ifdef HAVE_BLUA
 		if (LUAh_MobjDamage(target, inflictor, source, damage, damagetype) || P_MobjWasRemoved(target))
 			return true;
-#endif
 
 		if (target->health > 1)
 			target->flags2 |= MF2_FRET;
@@ -3631,10 +3617,8 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
 				|| (G_GametypeHasTeams() && player->ctfteam == source->player->ctfteam)))
 					return false; // Don't run eachother over in special stages and team games and such
 			}
-#ifdef HAVE_BLUA
 			if (LUAh_MobjDamage(target, inflictor, source, damage, damagetype))
 				return true;
-#endif
 			P_NiGHTSDamage(target, source); // -5s :(
 			return true;
 		}
@@ -3687,18 +3671,14 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
 			if (force
 			|| (inflictor && inflictor->flags & MF_MISSILE && inflictor->flags2 & MF2_SUPERFIRE)) // Super Sonic is stunned!
 			{
-#ifdef HAVE_BLUA
 				if (!LUAh_MobjDamage(target, inflictor, source, damage, damagetype))
-#endif
 					P_SuperDamage(player, inflictor, source, damage);
 				return true;
 			}
 			return false;
 		}
-#ifdef HAVE_BLUA
 		else if (LUAh_MobjDamage(target, inflictor, source, damage, damagetype))
 			return true;
-#endif
 		else if (player->powers[pw_shield] || (player->bot && !ultimatemode))  //If One-Hit Shield
 		{
 			P_ShieldDamage(player, inflictor, source, damage, damagetype);
diff --git a/src/p_local.h b/src/p_local.h
index 5e27379a76192f434618e204538b1711ad3ccdc0..becb045f70e976ac8457efb4aa1577d12efa1529 100644
--- a/src/p_local.h
+++ b/src/p_local.h
@@ -66,9 +66,7 @@ typedef enum
 	THINK_POLYOBJ,
 	THINK_MAIN,
 	THINK_MOBJ,
-#ifdef ESLOPE
 	THINK_DYNSLOPE,
-#endif
 	THINK_PRECIP,
 	NUM_THINKERLISTS
 } thinklistnum_t; /**< Thinker lists. */
@@ -250,7 +248,7 @@ extern jingle_t jingleinfo[NUMJINGLES];
 #define JINGLEPOSTFADE 1000
 
 void P_PlayJingle(player_t *player, jingletype_t jingletype);
-boolean P_EvaluateMusicStatus(UINT16 status);
+boolean P_EvaluateMusicStatus(UINT16 status, const char *musname);
 void P_PlayJingleMusic(player_t *player, const char *musname, UINT16 musflags, boolean looping, UINT16 status);
 
 //
@@ -383,9 +381,7 @@ extern mobj_t *tmfloorthing, *tmhitthing, *tmthing;
 extern camera_t *mapcampointer;
 extern fixed_t tmx;
 extern fixed_t tmy;
-#ifdef ESLOPE
 extern pslope_t *tmfloorslope, *tmceilingslope;
-#endif
 
 /* cphipps 2004/08/30 */
 extern void P_MapStart(void);
diff --git a/src/p_map.c b/src/p_map.c
index 96668481897bec73f922295bc2c89c7fc3d2b194..accc5283625048c8e2a761ff9e986652dbeb2261 100644
--- a/src/p_map.c
+++ b/src/p_map.c
@@ -27,9 +27,7 @@
 
 #include "r_splats.h"
 
-#ifdef ESLOPE
 #include "p_slopes.h"
-#endif
 
 #include "z_zone.h"
 
@@ -53,9 +51,7 @@ static fixed_t tmdropoffz, tmdrpoffceilz; // drop-off floor/ceiling heights
 mobj_t *tmfloorthing; // the thing corresponding to tmfloorz or NULL if tmfloorz is from a sector
 mobj_t *tmhitthing; // the solid thing you bumped into (for collisions)
 ffloor_t *tmfloorrover, *tmceilingrover;
-#ifdef ESLOPE
 pslope_t *tmfloorslope, *tmceilingslope;
-#endif
 
 // keep track of the line that lowers the ceiling,
 // so missiles don't explode against sky hack walls
@@ -262,9 +258,7 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object)
 	if (!vertispeed && !horizspeed)
 		return false;
 
-#ifdef ESLOPE
 	object->standingslope = NULL; // Okay, now we know it's not going to be relevant - no launching off at silly angles for you.
-#endif
 
 	if (spring->eflags & MFE_VERTICALFLIP)
 		vertispeed *= -1;
@@ -439,9 +433,7 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object)
 			P_SetPlayerMobjState(object, S_PLAY_FALL);
 	}
 
-#ifdef ESLOPE
 	object->standingslope = NULL; // And again.
-#endif
 
 	final = true;
 
@@ -491,9 +483,7 @@ static void P_DoFanAndGasJet(mobj_t *spring, mobj_t *object)
 		zdist = object->z - spring->z;
 	}
 
-#ifdef ESLOPE
 	object->standingslope = NULL; // No launching off at silly angles for you.
-#endif
 
 	switch (spring->type)
 	{
@@ -756,11 +746,9 @@ static boolean PIT_CheckThing(mobj_t *thing)
 		if (tmthing->z + tmthing->height < thing->z)
 			return true; // underneath
 
-#ifdef HAVE_BLUA
 		// REX HAS SEEN YOU
 		if (!LUAh_SeenPlayer(tmthing->target->player, thing->player))
 			return false;
-#endif
 
 		seenplayer = thing->player;
 		return false;
@@ -948,7 +936,6 @@ static boolean PIT_CheckThing(mobj_t *thing)
 			return true; // the line doesn't cross between either pair of opposite corners
 	}
 
-#ifdef HAVE_BLUA
 	{
 		UINT8 shouldCollide = LUAh_MobjCollide(thing, tmthing); // checks hook for thing's type
 		if (P_MobjWasRemoved(tmthing) || P_MobjWasRemoved(thing))
@@ -957,9 +944,8 @@ static boolean PIT_CheckThing(mobj_t *thing)
 			return false; // force collide
 		else if (shouldCollide == 2)
 			return true; // force no collide
-	}
-	{
-		UINT8 shouldCollide = LUAh_MobjMoveCollide(tmthing, thing); // checks hook for tmthing's type
+
+		shouldCollide = LUAh_MobjMoveCollide(tmthing, thing); // checks hook for tmthing's type
 		if (P_MobjWasRemoved(tmthing) || P_MobjWasRemoved(thing))
 			return true; // one of them was removed???
 		if (shouldCollide == 1)
@@ -967,7 +953,6 @@ static boolean PIT_CheckThing(mobj_t *thing)
 		else if (shouldCollide == 2)
 			return true; // force no collide
 	}
-#endif
 
 	if (tmthing->type == MT_LAVAFALL_LAVA && (thing->type == MT_RING || thing->type == MT_REDTEAMRING || thing->type == MT_BLUETEAMRING || thing->type == MT_FLINGRING))
 	{
@@ -1741,9 +1726,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
 				{
 					tmfloorz = thing->z + thing->height;
 					tmfloorrover = NULL;
-#ifdef ESLOPE
 					tmfloorslope = NULL;
-#endif
 				}
 				return true;
 			}
@@ -1762,18 +1745,14 @@ static boolean PIT_CheckThing(mobj_t *thing)
 
 				tmfloorz = tmceilingz = topz; // block while in air
 				tmceilingrover = NULL;
-#ifdef ESLOPE
 				tmceilingslope = NULL;
-#endif
 				tmfloorthing = thing; // needed for side collision
 			}
 			else if (topz < tmceilingz && tmthing->z <= thing->z+thing->height)
 			{
 				tmceilingz = topz;
 				tmceilingrover = NULL;
-#ifdef ESLOPE
 				tmceilingslope = NULL;
-#endif
 				tmfloorthing = thing; // thing we may stand on
 			}
 		}
@@ -1788,9 +1767,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
 				{
 					tmceilingz = thing->z;
 					tmceilingrover = NULL;
-#ifdef ESLOPE
 					tmceilingslope = NULL;
-#endif
 				}
 				return true;
 			}
@@ -1809,18 +1786,14 @@ static boolean PIT_CheckThing(mobj_t *thing)
 
 				tmfloorz = tmceilingz = topz; // block while in air
 				tmfloorrover = NULL;
-#ifdef ESLOPE
 				tmfloorslope = NULL;
-#endif
 				tmfloorthing = thing; // needed for side collision
 			}
 			else if (topz > tmfloorz && tmthing->z+tmthing->height >= thing->z)
 			{
 				tmfloorz = topz;
 				tmfloorrover = NULL;
-#ifdef ESLOPE
 				tmfloorslope = NULL;
-#endif
 				tmfloorthing = thing; // thing we may stand on
 			}
 		}
@@ -1946,7 +1919,6 @@ static boolean PIT_CheckLine(line_t *ld)
 	// this line is out of the if so upper and lower textures can be hit by a splat
 	blockingline = ld;
 
-#ifdef HAVE_BLUA
 	{
 		UINT8 shouldCollide = LUAh_MobjLineCollide(tmthing, blockingline); // checks hook for thing's type
 		if (P_MobjWasRemoved(tmthing))
@@ -1956,7 +1928,6 @@ static boolean PIT_CheckLine(line_t *ld)
 		else if (shouldCollide == 2)
 			return true; // force no collide
 	}
-#endif
 
 	if (!ld->backsector) // one sided line
 	{
@@ -1983,18 +1954,14 @@ static boolean PIT_CheckLine(line_t *ld)
 		tmceilingz = opentop;
 		ceilingline = ld;
 		tmceilingrover = openceilingrover;
-#ifdef ESLOPE
 		tmceilingslope = opentopslope;
-#endif
 	}
 
 	if (openbottom > tmfloorz)
 	{
 		tmfloorz = openbottom;
 		tmfloorrover = openfloorrover;
-#ifdef ESLOPE
 		tmfloorslope = openbottomslope;
-#endif
 	}
 
 	if (highceiling > tmdrpoffceilz)
@@ -2075,10 +2042,8 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y)
 	tmceilingz = P_GetCeilingZ(thing, newsubsec->sector, x, y, NULL); //newsubsec->sector->ceilingheight;
 	tmfloorrover = NULL;
 	tmceilingrover = NULL;
-#ifdef ESLOPE
 	tmfloorslope = newsubsec->sector->f_slope;
 	tmceilingslope = newsubsec->sector->c_slope;
-#endif
 
 	// Check list of fake floors and see if tmfloorz/tmceilingz need to be altered.
 	if (newsubsec->sector->ffloors)
@@ -2119,9 +2084,7 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y)
 						if (tmfloorz < topheight - sinklevel) {
 							tmfloorz = topheight - sinklevel;
 							tmfloorrover = rover;
-#ifdef ESLOPE
 							tmfloorslope = *rover->t_slope;
-#endif
 						}
 					}
 					else if (thing->eflags & MFE_VERTICALFLIP && thingtop <= bottomheight + sinklevel && thing->momz >= 0)
@@ -2129,9 +2092,7 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y)
 						if (tmceilingz > bottomheight + sinklevel) {
 							tmceilingz = bottomheight + sinklevel;
 							tmceilingrover = rover;
-#ifdef ESLOPE
 							tmceilingslope = *rover->b_slope;
-#endif
 						}
 					}
 				}
@@ -2154,9 +2115,7 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y)
 					if (tmfloorz < thing->z) {
 						tmfloorz = thing->z;
 						tmfloorrover = rover;
-#ifdef ESLOPE
 						tmfloorslope = NULL;
-#endif
 					}
 				}
 				// Quicksand blocks never change heights otherwise.
@@ -2173,9 +2132,7 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y)
 			{
 				tmfloorz = tmdropoffz = topheight;
 				tmfloorrover = rover;
-#ifdef ESLOPE
 				tmfloorslope = *rover->t_slope;
-#endif
 			}
 			if (bottomheight < tmceilingz && abs(delta1) >= abs(delta2)
 				&& !(rover->flags & FF_PLATFORM)
@@ -2183,9 +2140,7 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y)
 			{
 				tmceilingz = tmdrpoffceilz = bottomheight;
 				tmceilingrover = rover;
-#ifdef ESLOPE
 				tmceilingslope = *rover->b_slope;
-#endif
 			}
 		}
 	}
@@ -2260,17 +2215,13 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y)
 
 						if (polytop > tmfloorz && abs(delta1) < abs(delta2)) {
 							tmfloorz = tmdropoffz = polytop;
-#ifdef ESLOPE
 							tmfloorslope = NULL;
-#endif
 							tmfloorrover = NULL;
 						}
 
 						if (polybottom < tmceilingz && abs(delta1) >= abs(delta2)) {
 							tmceilingz = tmdrpoffceilz = polybottom;
-#ifdef ESLOPE
 							tmceilingslope = NULL;
-#endif
 							tmceilingrover = NULL;
 						}
 					}
@@ -2671,10 +2622,8 @@ boolean PIT_PushableMoved(mobj_t *thing)
 		line_t *oldblockline = blockingline;
 		ffloor_t *oldflrrover = tmfloorrover;
 		ffloor_t *oldceilrover = tmceilingrover;
-#ifdef ESLOPE
 		pslope_t *oldfslope = tmfloorslope;
 		pslope_t *oldcslope = tmceilingslope;
-#endif
 
 		// Move the player
 		P_TryMove(thing, thing->x+stand->momx, thing->y+stand->momy, true);
@@ -2689,10 +2638,8 @@ boolean PIT_PushableMoved(mobj_t *thing)
 		blockingline = oldblockline;
 		tmfloorrover = oldflrrover;
 		tmceilingrover = oldceilrover;
-#ifdef ESLOPE
 		tmfloorslope = oldfslope;
 		tmceilingslope = oldcslope;
-#endif
 		thing->momz = stand->momz;
 	}
 	else
@@ -2714,9 +2661,7 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff)
 	fixed_t tryy = thing->y;
 	fixed_t radius = thing->radius;
 	fixed_t thingtop = thing->z + thing->height;
-#ifdef ESLOPE
 	fixed_t startingonground = P_IsObjectOnGround(thing);
-#endif
 	floatok = false;
 
 	if (radius < MAXRADIUS/2)
@@ -2802,14 +2747,12 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff)
 						thing->ceilingrover = tmceilingrover;
 						thing->eflags |= MFE_JUSTSTEPPEDDOWN;
 					}
-#ifdef ESLOPE
 					else if (tmceilingz < thingtop && thingtop - tmceilingz <= maxstep)
 					{
 						thing->z = (thing->ceilingz = thingtop = tmceilingz) - thing->height;
 						thing->ceilingrover = tmceilingrover;
 						thing->eflags |= MFE_JUSTSTEPPEDDOWN;
 					}
-#endif
 				}
 				else if (thing->z == thing->floorz && tmfloorz < thing->z && thing->z - tmfloorz <= maxstep)
 				{
@@ -2817,14 +2760,12 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff)
 					thing->floorrover = tmfloorrover;
 					thing->eflags |= MFE_JUSTSTEPPEDDOWN;
 				}
-#ifdef ESLOPE
 				else if (tmfloorz > thing->z && tmfloorz - thing->z <= maxstep)
 				{
 					thing->z = thing->floorz = tmfloorz;
 					thing->floorrover = tmfloorrover;
 					thing->eflags |= MFE_JUSTSTEPPEDDOWN;
 				}
-#endif
 			}
 
 			if (thing->eflags & MFE_VERTICALFLIP)
@@ -2888,7 +2829,6 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff)
 	thing->floorrover = tmfloorrover;
 	thing->ceilingrover = tmceilingrover;
 
-#ifdef ESLOPE
 	if (!(thing->flags & MF_NOCLIPHEIGHT))
 	{
 		// Assign thing's standingslope if needed
@@ -2909,7 +2849,6 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff)
 	}
 	else // don't set standingslope if you're not going to clip against it
 		thing->standingslope = NULL;
-#endif
 
 	thing->x = x;
 	thing->y = y;
@@ -3275,13 +3214,8 @@ static boolean P_IsClimbingValid(player_t *player, angle_t angle)
 
 	glidesector = R_PointInSubsector(player->mo->x + platx, player->mo->y + platy);
 
-#ifdef ESLOPE
 	floorz = glidesector->sector->f_slope ? P_GetZAt(glidesector->sector->f_slope, player->mo->x, player->mo->y) : glidesector->sector->floorheight;
 	ceilingz = glidesector->sector->c_slope ? P_GetZAt(glidesector->sector->c_slope, player->mo->x, player->mo->y) : glidesector->sector->ceilingheight;
-#else
-	floorz = glidesector->sector->floorheight;
-	ceilingz = glidesector->sector->ceilingheight;
-#endif
 
 	if (glidesector->sector != player->mo->subsector->sector)
 	{
@@ -3299,12 +3233,10 @@ static boolean P_IsClimbingValid(player_t *player, angle_t angle)
 				topheight = *rover->topheight;
 				bottomheight = *rover->bottomheight;
 
-#ifdef ESLOPE
 				if (*rover->t_slope)
 					topheight = P_GetZAt(*rover->t_slope, player->mo->x, player->mo->y);
 				if (*rover->b_slope)
 					bottomheight = P_GetZAt(*rover->b_slope, player->mo->x, player->mo->y);
-#endif
 
 				floorclimb = true;
 
@@ -3460,12 +3392,10 @@ isblocking:
 				topheight = *rover->topheight;
 				bottomheight = *rover->bottomheight;
 
-#ifdef ESLOPE
 				if (*rover->t_slope)
 					topheight = P_GetZAt(*rover->t_slope, slidemo->x, slidemo->y);
 				if (*rover->b_slope)
 					bottomheight = P_GetZAt(*rover->b_slope, slidemo->x, slidemo->y);
-#endif
 
 				if (topheight < slidemo->z)
 					continue;
@@ -3670,10 +3600,8 @@ static void P_CheckLavaWall(mobj_t *mo, sector_t *sec)
 		if (rover->master->flags & ML_BLOCKMONSTERS)
 			continue;
 
-		topheight =
-#ifdef ESLOPE
-			*rover->t_slope ? P_GetZAt(*rover->t_slope, mo->x, mo->y) :
-#endif
+		topheight = *rover->t_slope ?
+			P_GetZAt(*rover->t_slope, mo->x, mo->y) :
 			*rover->topheight;
 
 		if (mo->eflags & MFE_VERTICALFLIP)
@@ -3687,10 +3615,8 @@ static void P_CheckLavaWall(mobj_t *mo, sector_t *sec)
 				continue;
 		}
 
-		bottomheight =
-#ifdef ESLOPE
-			*rover->b_slope ? P_GetZAt(*rover->b_slope, mo->x, mo->y) :
-#endif
+		bottomheight = *rover->b_slope ?
+			P_GetZAt(*rover->b_slope, mo->x, mo->y) :
 			*rover->bottomheight;
 
 		if (mo->eflags & MFE_VERTICALFLIP)
@@ -4278,12 +4204,10 @@ static boolean PIT_ChangeSector(mobj_t *thing, boolean realcrush)
 				topheight = *rover->topheight;
 				bottomheight = *rover->bottomheight;
 
-/*#ifdef ESLOPE
-				if (rover->t_slope)
+				/*if (rover->t_slope)
 					topheight = P_GetZAt(rover->t_slope, thing->x, thing->y);
 				if (rover->b_slope)
-					bottomheight = P_GetZAt(rover->b_slope, thing->x, thing->y);
-#endif*/
+					bottomheight = P_GetZAt(rover->b_slope, thing->x, thing->y);*/
 
 				delta1 = thing->z - (bottomheight + topheight)/2;
 				delta2 = thingtop - (bottomheight + topheight)/2;
@@ -5064,10 +4988,8 @@ fixed_t P_FloorzAtPos(fixed_t x, fixed_t y, fixed_t z, fixed_t height)
 	sector_t *sec = R_PointInSubsector(x, y)->sector;
 	fixed_t floorz = sec->floorheight;
 
-#ifdef ESLOPE
 	if (sec->f_slope)
 		floorz = P_GetZAt(sec->f_slope, x, y);
-#endif
 
 	// Intercept the stupid 'fall through 3dfloors' bug Tails 03-17-2002
 	if (sec->ffloors)
@@ -5087,12 +5009,10 @@ fixed_t P_FloorzAtPos(fixed_t x, fixed_t y, fixed_t z, fixed_t height)
 			topheight = *rover->topheight;
 			bottomheight = *rover->bottomheight;
 
-#ifdef ESLOPE
 			if (*rover->t_slope)
 				topheight = P_GetZAt(*rover->t_slope, x, y);
 			if (*rover->b_slope)
 				bottomheight = P_GetZAt(*rover->b_slope, x, y);
-#endif
 
 			if (rover->flags & FF_QUICKSAND)
 			{
diff --git a/src/p_maputl.c b/src/p_maputl.c
index 69be5a70f70debfaff7f3cc0c1da64c000a6c867..bfca72edaa512ceac4b13f36168f678eed7002e5 100644
--- a/src/p_maputl.c
+++ b/src/p_maputl.c
@@ -277,9 +277,7 @@ fixed_t P_InterceptVector(divline_t *v2, divline_t *v1)
 // OPTIMIZE: keep this precalculated
 //
 fixed_t opentop, openbottom, openrange, lowfloor, highceiling;
-#ifdef ESLOPE
 pslope_t *opentopslope, *openbottomslope;
-#endif
 ffloor_t *openfloorrover, *openceilingrover;
 
 // P_CameraLineOpening
@@ -307,24 +305,20 @@ void P_CameraLineOpening(line_t *linedef)
 	{
 		frontfloor = sectors[front->camsec].floorheight;
 		frontceiling = sectors[front->camsec].ceilingheight;
-#ifdef ESLOPE
 		if (sectors[front->camsec].f_slope) // SRB2CBTODO: ESLOPE (sectors[front->heightsec].f_slope)
 			frontfloor = P_GetZAt(sectors[front->camsec].f_slope, camera.x, camera.y);
 		if (sectors[front->camsec].c_slope)
 			frontceiling = P_GetZAt(sectors[front->camsec].c_slope, camera.x, camera.y);
-#endif
 
 	}
 	else if (front->heightsec >= 0)
 	{
 		frontfloor = sectors[front->heightsec].floorheight;
 		frontceiling = sectors[front->heightsec].ceilingheight;
-#ifdef ESLOPE
 		if (sectors[front->heightsec].f_slope) // SRB2CBTODO: ESLOPE (sectors[front->heightsec].f_slope)
 			frontfloor = P_GetZAt(sectors[front->heightsec].f_slope, camera.x, camera.y);
 		if (sectors[front->heightsec].c_slope)
 			frontceiling = P_GetZAt(sectors[front->heightsec].c_slope, camera.x, camera.y);
-#endif
 	}
 	else
 	{
@@ -335,23 +329,19 @@ void P_CameraLineOpening(line_t *linedef)
 	{
 		backfloor = sectors[back->camsec].floorheight;
 		backceiling = sectors[back->camsec].ceilingheight;
-#ifdef ESLOPE
 		if (sectors[back->camsec].f_slope) // SRB2CBTODO: ESLOPE (sectors[front->heightsec].f_slope)
 			frontfloor = P_GetZAt(sectors[back->camsec].f_slope, camera.x, camera.y);
 		if (sectors[back->camsec].c_slope)
 			frontceiling = P_GetZAt(sectors[back->camsec].c_slope, camera.x, camera.y);
-#endif
 	}
 	else if (back->heightsec >= 0)
 	{
 		backfloor = sectors[back->heightsec].floorheight;
 		backceiling = sectors[back->heightsec].ceilingheight;
-#ifdef ESLOPE
 		if (sectors[back->heightsec].f_slope) // SRB2CBTODO: ESLOPE (sectors[front->heightsec].f_slope)
 			frontfloor = P_GetZAt(sectors[back->heightsec].f_slope, camera.x, camera.y);
 		if (sectors[back->heightsec].c_slope)
 			frontceiling = P_GetZAt(sectors[back->heightsec].c_slope, camera.x, camera.y);
-#endif
 	}
 	else
 	{
@@ -469,9 +459,7 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
 		openbottom = INT32_MIN;
 		highceiling = INT32_MIN;
 		lowfloor = INT32_MAX;
-#ifdef ESLOPE
 		opentopslope = openbottomslope = NULL;
-#endif
 	}
 	else
 #endif
@@ -485,17 +473,13 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
 		{
 			opentop = frontheight;
 			highceiling = backheight;
-#ifdef ESLOPE
 			opentopslope = front->c_slope;
-#endif
 		}
 		else
 		{
 			opentop = backheight;
 			highceiling = frontheight;
-#ifdef ESLOPE
 			opentopslope = back->c_slope;
-#endif
 		}
 
 		frontheight = P_GetFloorZ(mobj, front, tmx, tmy, linedef);
@@ -505,17 +489,13 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
 		{
 			openbottom = frontheight;
 			lowfloor = backheight;
-#ifdef ESLOPE
 			openbottomslope = front->f_slope;
-#endif
 		}
 		else
 		{
 			openbottom = backheight;
 			lowfloor = frontheight;
-#ifdef ESLOPE
 			openbottomslope = back->f_slope;
-#endif
 		}
 	}
 
@@ -647,9 +627,7 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
 				{
 					if (bottomheight < opentop) {
 						opentop = bottomheight;
-#ifdef ESLOPE
 						opentopslope = *rover->b_slope;
-#endif
 						openceilingrover = rover;
 					}
 					else if (bottomheight < highceiling)
@@ -660,9 +638,7 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
 				{
 					if (topheight > openbottom) {
 						openbottom = topheight;
-#ifdef ESLOPE
 						openbottomslope = *rover->t_slope;
-#endif
 						openfloorrover = rover;
 					}
 					else if (topheight > lowfloor)
@@ -693,9 +669,7 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
 				{
 					if (bottomheight < opentop) {
 						opentop = bottomheight;
-#ifdef ESLOPE
 						opentopslope = *rover->b_slope;
-#endif
 						openceilingrover = rover;
 					}
 					else if (bottomheight < highceiling)
@@ -706,9 +680,7 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
 				{
 					if (topheight > openbottom) {
 						openbottom = topheight;
-#ifdef ESLOPE
 						openbottomslope = *rover->t_slope;
-#endif
 						openfloorrover = rover;
 					}
 					else if (topheight > lowfloor)
diff --git a/src/p_maputl.h b/src/p_maputl.h
index bb09c3ed1881f8a65b901f242aaa40632841473e..08b606833cd7895e11211de6eb94b4742f13125e 100644
--- a/src/p_maputl.h
+++ b/src/p_maputl.h
@@ -55,9 +55,7 @@ void P_CreatePrecipSecNodeList(precipmobj_t *thing, fixed_t x,fixed_t y);
 boolean P_SceneryTryMove(mobj_t *thing, fixed_t x, fixed_t y);
 
 extern fixed_t opentop, openbottom, openrange, lowfloor, highceiling;
-#ifdef ESLOPE
 extern pslope_t *opentopslope, *openbottomslope;
-#endif
 extern ffloor_t *openfloorrover, *openceilingrover;
 
 void P_LineOpening(line_t *plinedef, mobj_t *mobj);
diff --git a/src/p_mobj.c b/src/p_mobj.c
index 76396b039ca504d672e53b1ed3760cf73bfe762a..b27d27a769ca23cb5274ef653d427694021e0650 100644
--- a/src/p_mobj.c
+++ b/src/p_mobj.c
@@ -19,7 +19,7 @@
 #include "p_local.h"
 #include "p_setup.h"
 #include "r_main.h"
-#include "r_things.h"
+#include "r_skins.h"
 #include "r_sky.h"
 #include "r_splats.h"
 #include "s_sound.h"
@@ -31,9 +31,7 @@
 #include "i_video.h"
 #include "lua_hook.h"
 #include "b_bot.h"
-#ifdef ESLOPE
 #include "p_slopes.h"
-#endif
 #include "f_finale.h"
 #include "m_cond.h"
 
@@ -62,9 +60,7 @@ void P_RunCachedActions(void)
 	{
 		var1 = states[ac->statenum].var1;
 		var2 = states[ac->statenum].var2;
-#ifdef HAVE_BLUA
 		astate = &states[ac->statenum];
-#endif
 		if (ac->mobj && !P_MobjWasRemoved(ac->mobj)) // just in case...
 			states[ac->statenum].action.acp1(ac->mobj);
 		next = ac->next;
@@ -459,9 +455,7 @@ boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state)
 		{
 			var1 = st->var1;
 			var2 = st->var2;
-#ifdef HAVE_BLUA
 			astate = st;
-#endif
 			st->action.acp1(mobj);
 
 			// woah. a player was removed by an action.
@@ -585,9 +579,7 @@ boolean P_SetMobjState(mobj_t *mobj, statenum_t state)
 		{
 			var1 = st->var1;
 			var2 = st->var2;
-#ifdef HAVE_BLUA
 			astate = st;
-#endif
 			st->action.acp1(mobj);
 			if (P_MobjWasRemoved(mobj))
 				return false;
@@ -937,12 +929,10 @@ boolean P_InsideANonSolidFFloor(mobj_t *mobj, ffloor_t *rover)
 	topheight = *rover->topheight;
 	bottomheight = *rover->bottomheight;
 
-#ifdef ESLOPE
 	if (*rover->t_slope)
 		topheight = P_GetZAt(*rover->t_slope, mobj->x, mobj->y);
 	if (*rover->b_slope)
 		bottomheight = P_GetZAt(*rover->b_slope, mobj->x, mobj->y);
-#endif
 
 	if (mobj->z > topheight)
 		return false;
@@ -953,7 +943,6 @@ boolean P_InsideANonSolidFFloor(mobj_t *mobj, ffloor_t *rover)
 	return true;
 }
 
-#ifdef ESLOPE
 // P_GetFloorZ (and its ceiling counterpart)
 // Gets the floor height (or ceiling height) of the mobj's contact point in sector, assuming object's center if moved to [x, y]
 // If line is supplied, it's a divider line on the sector. Set it to NULL if you're not checking for collision with a line
@@ -1057,15 +1046,12 @@ static fixed_t HighestOnLine(fixed_t radius, fixed_t x, fixed_t y, line_t *line,
 			P_GetZAt(slope, v2.x, v2.y)
 		);
 }
-#endif
 
 fixed_t P_MobjFloorZ(mobj_t *mobj, sector_t *sector, sector_t *boundsec, fixed_t x, fixed_t y, line_t *line, boolean lowest, boolean perfect)
 {
-#ifdef ESLOPE
 	I_Assert(mobj != NULL);
-#endif
 	I_Assert(sector != NULL);
-#ifdef ESLOPE
+
 	if (sector->f_slope) {
 		fixed_t testx, testy;
 		pslope_t *slope = sector->f_slope;
@@ -1135,25 +1121,14 @@ fixed_t P_MobjFloorZ(mobj_t *mobj, sector_t *sector, sector_t *boundsec, fixed_t
 
 		return HighestOnLine(mobj->radius, x, y, line, slope, lowest);
 	} else // Well, that makes it easy. Just get the floor height
-#else
-	(void)mobj;
-	(void)boundsec;
-	(void)x;
-	(void)y;
-	(void)line;
-	(void)lowest;
-	(void)perfect;
-#endif
 		return sector->floorheight;
 }
 
 fixed_t P_MobjCeilingZ(mobj_t *mobj, sector_t *sector, sector_t *boundsec, fixed_t x, fixed_t y, line_t *line, boolean lowest, boolean perfect)
 {
-#ifdef ESLOPE
 	I_Assert(mobj != NULL);
-#endif
 	I_Assert(sector != NULL);
-#ifdef ESLOPE
+
 	if (sector->c_slope) {
 		fixed_t testx, testy;
 		pslope_t *slope = sector->c_slope;
@@ -1223,26 +1198,15 @@ fixed_t P_MobjCeilingZ(mobj_t *mobj, sector_t *sector, sector_t *boundsec, fixed
 
 		return HighestOnLine(mobj->radius, x, y, line, slope, lowest);
 	} else // Well, that makes it easy. Just get the ceiling height
-#else
-	(void)mobj;
-	(void)boundsec;
-	(void)x;
-	(void)y;
-	(void)line;
-	(void)lowest;
-	(void)perfect;
-#endif
 		return sector->ceilingheight;
 }
 
 // Now do the same as all above, but for cameras because apparently cameras are special?
 fixed_t P_CameraFloorZ(camera_t *mobj, sector_t *sector, sector_t *boundsec, fixed_t x, fixed_t y, line_t *line, boolean lowest, boolean perfect)
 {
-#ifdef ESLOPE
 	I_Assert(mobj != NULL);
-#endif
 	I_Assert(sector != NULL);
-#ifdef ESLOPE
+
 	if (sector->f_slope) {
 		fixed_t testx, testy;
 		pslope_t *slope = sector->f_slope;
@@ -1312,25 +1276,14 @@ fixed_t P_CameraFloorZ(camera_t *mobj, sector_t *sector, sector_t *boundsec, fix
 
 		return HighestOnLine(mobj->radius, x, y, line, slope, lowest);
 	} else // Well, that makes it easy. Just get the floor height
-#else
-	(void)mobj;
-	(void)boundsec;
-	(void)x;
-	(void)y;
-	(void)line;
-	(void)lowest;
-	(void)perfect;
-#endif
 		return sector->floorheight;
 }
 
 fixed_t P_CameraCeilingZ(camera_t *mobj, sector_t *sector, sector_t *boundsec, fixed_t x, fixed_t y, line_t *line, boolean lowest, boolean perfect)
 {
-#ifdef ESLOPE
 	I_Assert(mobj != NULL);
-#endif
 	I_Assert(sector != NULL);
-#ifdef ESLOPE
+
 	if (sector->c_slope) {
 		fixed_t testx, testy;
 		pslope_t *slope = sector->c_slope;
@@ -1400,15 +1353,6 @@ fixed_t P_CameraCeilingZ(camera_t *mobj, sector_t *sector, sector_t *boundsec, f
 
 		return HighestOnLine(mobj->radius, x, y, line, slope, lowest);
 	} else // Well, that makes it easy. Just get the ceiling height
-#else
-	(void)mobj;
-	(void)boundsec;
-	(void)x;
-	(void)y;
-	(void)line;
-	(void)lowest;
-	(void)perfect;
-#endif
 		return sector->ceilingheight;
 }
 static void P_PlayerFlip(mobj_t *mo)
@@ -1680,10 +1624,7 @@ static void P_XYFriction(mobj_t *mo, fixed_t oldx, fixed_t oldy)
 		else if (abs(player->rmomx) < FixedMul(STOPSPEED, mo->scale)
 		    && abs(player->rmomy) < FixedMul(STOPSPEED, mo->scale)
 		    && (!(player->cmd.forwardmove && !(twodlevel || mo->flags2 & MF2_TWOD)) && !player->cmd.sidemove && !(player->pflags & PF_SPINNING))
-#ifdef ESLOPE
-			&& !(player->mo->standingslope && (!(player->mo->standingslope->flags & SL_NOPHYSICS)) && (abs(player->mo->standingslope->zdelta) >= FRACUNIT/2))
-#endif
-				)
+			&& !(player->mo->standingslope && (!(player->mo->standingslope->flags & SL_NOPHYSICS)) && (abs(player->mo->standingslope->zdelta) >= FRACUNIT/2)))
 		{
 			// if in a walking frame, stop moving
 			if (player->panim == PA_WALK)
@@ -1830,11 +1771,9 @@ void P_XYMovement(mobj_t *mo)
 	fixed_t xmove, ymove;
 	fixed_t oldx, oldy; // reducing bobbing/momentum on ice when up against walls
 	boolean moved;
-#ifdef ESLOPE
 	pslope_t *oldslope = NULL;
 	vector3_t slopemom;
 	fixed_t predictedz = 0;
-#endif
 
 	I_Assert(mo != NULL);
 	I_Assert(!P_MobjWasRemoved(mo));
@@ -1864,7 +1803,6 @@ void P_XYMovement(mobj_t *mo)
 	oldx = mo->x;
 	oldy = mo->y;
 
-#ifdef ESLOPE
 	if (mo->flags & MF_NOCLIPHEIGHT)
 		mo->standingslope = NULL;
 
@@ -1889,7 +1827,6 @@ void P_XYMovement(mobj_t *mo)
 		}
 	} else if (P_IsObjectOnGround(mo) && !mo->momz)
 		predictedz = mo->z;
-#endif
 
 	// Pushables can break some blocks
 	if (CheckForBustableBlocks && ((mo->flags & MF_PUSHABLE) || ((mo->info->flags & MF_PUSHABLE) && mo->fuse)))
@@ -1906,15 +1843,12 @@ void P_XYMovement(mobj_t *mo)
 				B_MoveBlocked(player);
 		}
 
-#ifdef HAVE_BLUA
 		if (LUAh_MobjMoveBlocked(mo))
 		{
 			if (P_MobjWasRemoved(mo))
 				return;
 		}
-		else
-#endif
-		if (P_MobjWasRemoved(mo))
+		else if (P_MobjWasRemoved(mo))
 			return;
 		else if (mo->flags & MF_BOUNCE)
 		{
@@ -1965,7 +1899,6 @@ void P_XYMovement(mobj_t *mo)
 		}
 		else if (player || mo->flags & (MF_SLIDEME|MF_PUSHABLE))
 		{ // try to slide along it
-#ifdef ESLOPE
 			// Wall transfer part 1.
 			pslope_t *transferslope = NULL;
 			fixed_t transfermomz = 0;
@@ -1975,14 +1908,12 @@ void P_XYMovement(mobj_t *mo)
 				if (((transferslope->zangle < ANGLE_180) ? transferslope->zangle : InvAngle(transferslope->zangle)) >= ANGLE_45) // Prevent some weird stuff going on on shallow slopes.
 					transfermomz = P_GetWallTransferMomZ(mo, transferslope);
 			}
-#endif
 
 			P_SlideMove(mo);
 			if (player)
 				player->powers[pw_pushing] = 3;
 			xmove = ymove = 0;
 
-#ifdef ESLOPE
 			// Wall transfer part 2.
 			if (transfermomz && transferslope) // Are we "transferring onto the wall" (really just a disguised vertical launch)?
 			{
@@ -2005,7 +1936,6 @@ void P_XYMovement(mobj_t *mo)
 					}
 				}
 			}
-#endif
 		}
 		else if (mo->type == MT_SPINFIRE)
 		{
@@ -2061,7 +1991,6 @@ void P_XYMovement(mobj_t *mo)
 	if (P_MobjWasRemoved(mo)) // MF_SPECIAL touched a player! O_o;;
 		return;
 
-#ifdef ESLOPE
 	if (moved && oldslope && !(mo->flags & MF_NOCLIPHEIGHT)) { // Check to see if we ran off
 
 		if (oldslope != mo->standingslope) { // First, compare different slopes
@@ -2107,7 +2036,6 @@ void P_XYMovement(mobj_t *mo)
 			//CONS_Printf("Launched off of flat surface running into downward slope\n");
 		}
 	}
-#endif
 
 	// Check the gravity status.
 	P_CheckGravity(mo, false);
@@ -2158,11 +2086,9 @@ void P_XYMovement(mobj_t *mo)
 	if (player && player->powers[pw_carry] == CR_NIGHTSMODE)
 		return; // no friction for NiGHTS players
 
-#ifdef ESLOPE
 	if ((mo->type == MT_BIGTUMBLEWEED || mo->type == MT_LITTLETUMBLEWEED)
 			&& (mo->standingslope && abs(mo->standingslope->zdelta) > FRACUNIT>>8)) // Special exception for tumbleweeds on slopes
 		return;
-#endif
 
 	if (((!(mo->eflags & MFE_VERTICALFLIP) && mo->z > mo->floorz) || (mo->eflags & MFE_VERTICALFLIP && mo->z+mo->height < mo->ceilingz))
 		&& !(player && player->pflags & PF_SLIDING))
@@ -2430,7 +2356,6 @@ static boolean P_ZMovement(mobj_t *mo)
 	mo->z += mo->momz;
 	onground = P_IsObjectOnGround(mo);
 
-#ifdef ESLOPE
 	if (mo->standingslope)
 	{
 		if (mo->flags & MF_NOCLIPHEIGHT)
@@ -2438,7 +2363,6 @@ static boolean P_ZMovement(mobj_t *mo)
 		else if (!onground)
 			P_SlopeLaunch(mo);
 	}
-#endif
 
 	switch (mo->type)
 	{
@@ -2640,7 +2564,6 @@ static boolean P_ZMovement(mobj_t *mo)
 		else
 			mo->z = mo->floorz;
 
-#ifdef ESLOPE
 		if (!(mo->flags & MF_MISSILE) && mo->standingslope) // You're still on the ground; why are we here?
 		{
 			mo->momz = 0;
@@ -2653,7 +2576,6 @@ static boolean P_ZMovement(mobj_t *mo)
 			mo->standingslope = (mo->eflags & MFE_VERTICALFLIP) ? tmceilingslope : tmfloorslope;
 			P_ReverseQuantizeMomentumToSlope(&mom, mo->standingslope);
 		}
-#endif
 
 		// hit the floor
 		if (mo->type == MT_FIREBALL) // special case for the fireball
@@ -2753,13 +2675,11 @@ static boolean P_ZMovement(mobj_t *mo)
 							else
 								mom.y -= FixedMul(6*FRACUNIT, mo->scale);
 						}
-#ifdef ESLOPE
 						else if (mo->standingslope && abs(mo->standingslope->zdelta) > FRACUNIT>>8)
 						{
 							// Pop the object up a bit to encourage bounciness
 							//mom.z = P_MobjFlip(mo)*mo->scale;
 						}
-#endif
 						else
 						{
 							mom.x = mom.y = mom.z = 0;
@@ -2799,11 +2719,9 @@ static boolean P_ZMovement(mobj_t *mo)
 		else if (tmfloorthing)
 			mom.z = tmfloorthing->momz;
 
-#ifdef ESLOPE
 		if (mo->standingslope) { // MT_STEAM will never have a standingslope, see above.
 			P_QuantizeMomentumToSlope(&mom, mo->standingslope);
 		}
-#endif
 
 		mo->momx = mom.x;
 		mo->momy = mom.y;
@@ -2925,7 +2843,6 @@ static void P_PlayerZMovement(mobj_t *mo)
 	|| mo->player->playerstate == PST_REBORN)
 		return;
 
-#ifdef ESLOPE
 	if (mo->standingslope)
 	{
 		if (mo->flags & MF_NOCLIPHEIGHT)
@@ -2933,7 +2850,6 @@ static void P_PlayerZMovement(mobj_t *mo)
 		else if (!onground)
 			P_SlopeLaunch(mo);
 	}
-#endif
 
 	// clip movement
 	if (onground && !(mo->flags & MF_NOCLIPHEIGHT))
@@ -2961,12 +2877,10 @@ static void P_PlayerZMovement(mobj_t *mo)
 		if (mo->player->panim == PA_PAIN)
 			P_SetPlayerMobjState(mo, S_PLAY_WALK);
 
-#ifdef ESLOPE
 		if (!mo->standingslope && (mo->eflags & MFE_VERTICALFLIP ? tmceilingslope : tmfloorslope)) {
 			// Handle landing on slope during Z movement
 			P_HandleSlopeLanding(mo, (mo->eflags & MFE_VERTICALFLIP ? tmceilingslope : tmfloorslope));
 		}
-#endif
 
 		if (P_MobjFlip(mo)*mo->momz < 0) // falling
 		{
@@ -3299,10 +3213,8 @@ static boolean P_SceneryZMovement(mobj_t *mo)
 //
 boolean P_CanRunOnWater(player_t *player, ffloor_t *rover)
 {
-	fixed_t topheight =
-#ifdef ESLOPE
-		*rover->t_slope ? P_GetZAt(*rover->t_slope, player->mo->x, player->mo->y) :
-#endif
+	fixed_t topheight = *rover->t_slope ?
+		P_GetZAt(*rover->t_slope, player->mo->x, player->mo->y) :
 		*rover->topheight;
 
 	if (!player->powers[pw_carry] && !player->homing
@@ -3349,13 +3261,11 @@ void P_MobjCheckWater(mobj_t *mobj)
 		topheight = *rover->topheight;
 		bottomheight = *rover->bottomheight;
 
-#ifdef ESLOPE
 		if (*rover->t_slope)
 			topheight = P_GetZAt(*rover->t_slope, mobj->x, mobj->y);
 
 		if (*rover->b_slope)
 			bottomheight = P_GetZAt(*rover->b_slope, mobj->x, mobj->y);
-#endif
 
 		if (mobj->eflags & MFE_VERTICALFLIP)
 		{
@@ -3605,13 +3515,11 @@ static void P_SceneryCheckWater(mobj_t *mobj)
 			topheight = *rover->topheight;
 			bottomheight = *rover->bottomheight;
 
-#ifdef ESLOPE
 			if (*rover->t_slope)
 				topheight = P_GetZAt(*rover->t_slope, mobj->x, mobj->y);
 
 			if (*rover->b_slope)
 				bottomheight = P_GetZAt(*rover->b_slope, mobj->x, mobj->y);
-#endif
 
 			if (topheight <= mobj->z
 				|| bottomheight > (mobj->z + (mobj->height>>1)))
@@ -3656,14 +3564,12 @@ static boolean P_CameraCheckHeat(camera_t *thiscam)
 			if (!(rover->flags & FF_EXISTS))
 				continue;
 
-			if (halfheight >= (
-#ifdef ESLOPE
-					*rover->t_slope ? P_GetZAt(*rover->t_slope, thiscam->x, thiscam->y) :
-#endif
-					*rover->topheight) || halfheight <= (
-#ifdef ESLOPE
-					*rover->b_slope ? P_GetZAt(*rover->b_slope, thiscam->x, thiscam->y) :
-#endif
+			if (halfheight >= (*rover->t_slope ?
+					P_GetZAt(*rover->t_slope, thiscam->x, thiscam->y) :
+					*rover->topheight))
+				continue;
+			if (halfheight <= (*rover->b_slope ?
+					P_GetZAt(*rover->b_slope, thiscam->x, thiscam->y) :
 					*rover->bottomheight))
 				continue;
 
@@ -3692,14 +3598,12 @@ static boolean P_CameraCheckWater(camera_t *thiscam)
 			if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_SWIMMABLE) || rover->flags & FF_BLOCKOTHERS)
 				continue;
 
-			if (halfheight >= (
-#ifdef ESLOPE
-					*rover->t_slope ? P_GetZAt(*rover->t_slope, thiscam->x, thiscam->y) :
-#endif
-					*rover->topheight) || halfheight <= (
-#ifdef ESLOPE
+			if (halfheight >= (*rover->t_slope ?
+					P_GetZAt(*rover->t_slope, thiscam->x, thiscam->y) :
+					*rover->topheight))
+				continue;
+			if (halfheight <= (
 					*rover->b_slope ? P_GetZAt(*rover->b_slope, thiscam->x, thiscam->y) :
-#endif
 					*rover->bottomheight))
 				continue;
 
@@ -3889,9 +3793,7 @@ static void P_PlayerMobjThinker(mobj_t *mobj)
 
 	P_MobjCheckWater(mobj);
 
-#ifdef ESLOPE
 	P_ButteredSlope(mobj);
-#endif
 
 	// momentum movement
 	mobj->eflags &= ~MFE_JUSTSTEPPEDDOWN;
@@ -4050,10 +3952,8 @@ static void CalculatePrecipFloor(precipmobj_t *mobj)
 		mobjsecsubsec = mobj->subsector->sector;
 	else
 		return;
-	mobj->floorz =
-#ifdef ESLOPE
-				mobjsecsubsec->f_slope ? P_GetZAt(mobjsecsubsec->f_slope, mobj->x, mobj->y) :
-#endif
+	mobj->floorz = mobjsecsubsec->f_slope ?
+				P_GetZAt(mobjsecsubsec->f_slope, mobj->x, mobj->y) :
 				mobjsecsubsec->floorheight;
 	if (mobjsecsubsec->ffloors)
 	{
@@ -4069,12 +3969,10 @@ static void CalculatePrecipFloor(precipmobj_t *mobj)
 			if (!(rover->flags & FF_BLOCKOTHERS) && !(rover->flags & FF_SWIMMABLE))
 				continue;
 
-#ifdef ESLOPE
 			if (*rover->t_slope)
 				topheight = P_GetZAt(*rover->t_slope, mobj->x, mobj->y);
 			else
-#endif
-			topheight = *rover->topheight;
+				topheight = *rover->topheight;
 
 			if (topheight > mobj->floorz)
 				mobj->floorz = topheight;
@@ -7643,12 +7541,10 @@ static void P_RosySceneryThink(mobj_t *mobj)
 
 static void P_MobjSceneryThink(mobj_t *mobj)
 {
-#ifdef HAVE_BLUA
 	if (LUAh_MobjThinker(mobj))
 		return;
 	if (P_MobjWasRemoved(mobj))
 		return;
-#endif
 
 	if ((mobj->flags2 & MF2_SHIELD) && !P_AddShield(mobj))
 		return;
@@ -7993,9 +7889,7 @@ static void P_MobjSceneryThink(mobj_t *mobj)
 
 		if (!mobj->fuse)
 		{
-#ifdef HAVE_BLUA
 			if (!LUAh_MobjFuse(mobj))
-#endif
 				P_RemoveMobj(mobj);
 			return;
 		}
@@ -8054,9 +7948,7 @@ static void P_MobjSceneryThink(mobj_t *mobj)
 			mobj->fuse--;
 			if (!mobj->fuse)
 			{
-#ifdef HAVE_BLUA
 				if (!LUAh_MobjFuse(mobj))
-#endif
 					P_RemoveMobj(mobj);
 				return;
 			}
@@ -8085,7 +7977,6 @@ static boolean P_MobjPushableThink(mobj_t *mobj)
 
 static boolean P_MobjBossThink(mobj_t *mobj)
 {
-#ifdef HAVE_BLUA
 	if (LUAh_BossThinker(mobj))
 	{
 		if (P_MobjWasRemoved(mobj))
@@ -8094,7 +7985,6 @@ static boolean P_MobjBossThink(mobj_t *mobj)
 	else if (P_MobjWasRemoved(mobj))
 		return false;
 	else
-#endif
 		switch (mobj->type)
 		{
 		case MT_EGGMOBILE:
@@ -10004,113 +9894,110 @@ static boolean P_FuseThink(mobj_t *mobj)
 	if (mobj->fuse)
 		return true;
 
-#ifdef HAVE_BLUA
 	if (LUAh_MobjFuse(mobj) || P_MobjWasRemoved(mobj))
 		;
-	else
-#endif
-		if (mobj->info->flags & MF_MONITOR)
+	else if (mobj->info->flags & MF_MONITOR)
+	{
+		P_MonitorFuseThink(mobj);
+		return false;
+	}
+	else switch (mobj->type)
+	{
+		// gargoyle and snowman handled in P_PushableThinker, not here
+	case MT_THROWNGRENADE:
+	case MT_CYBRAKDEMON_NAPALM_BOMB_LARGE:
+		P_SetMobjState(mobj, mobj->info->deathstate);
+		break;
+	case MT_LHRT:
+		P_KillMobj(mobj, NULL, NULL, 0);
+		break;
+	case MT_BLUEFLAG:
+	case MT_REDFLAG:
+		P_FlagFuseThink(mobj);
+		P_RemoveMobj(mobj);
+		return false;
+	case MT_FANG:
+		if (mobj->flags2 & MF2_SLIDEPUSH)
 		{
-			P_MonitorFuseThink(mobj);
+			var1 = 0;
+			var2 = 0;
+			A_BossDeath(mobj);
 			return false;
 		}
-		else switch (mobj->type)
-		{
-			// gargoyle and snowman handled in P_PushableThinker, not here
-		case MT_THROWNGRENADE:
-		case MT_CYBRAKDEMON_NAPALM_BOMB_LARGE:
-			P_SetMobjState(mobj, mobj->info->deathstate);
-			break;
-		case MT_LHRT:
-			P_KillMobj(mobj, NULL, NULL, 0);
-			break;
-		case MT_BLUEFLAG:
-		case MT_REDFLAG:
-			P_FlagFuseThink(mobj);
-			P_RemoveMobj(mobj);
+		P_SetMobjState(mobj, mobj->state->nextstate);
+		if (P_MobjWasRemoved(mobj))
 			return false;
-		case MT_FANG:
-			if (mobj->flags2 & MF2_SLIDEPUSH)
-			{
-				var1 = 0;
-				var2 = 0;
-				A_BossDeath(mobj);
-				return false;
-			}
-			P_SetMobjState(mobj, mobj->state->nextstate);
-			if (P_MobjWasRemoved(mobj))
-				return false;
-			break;
-		case MT_METALSONIC_BATTLE:
-			break; // don't remove
-		case MT_SPIKE:
-			P_SetMobjState(mobj, mobj->state->nextstate);
-			mobj->fuse = mobj->info->speed;
-			if (mobj->spawnpoint)
-				mobj->fuse += mobj->spawnpoint->angle;
-			break;
-		case MT_WALLSPIKE:
-			P_SetMobjState(mobj, mobj->state->nextstate);
-			mobj->fuse = mobj->info->speed;
-			if (mobj->spawnpoint)
-				mobj->fuse += (mobj->spawnpoint->angle / 360);
+		break;
+	case MT_METALSONIC_BATTLE:
+		break; // don't remove
+	case MT_SPIKE:
+		P_SetMobjState(mobj, mobj->state->nextstate);
+		mobj->fuse = mobj->info->speed;
+		if (mobj->spawnpoint)
+			mobj->fuse += mobj->spawnpoint->angle;
+		break;
+	case MT_WALLSPIKE:
+		P_SetMobjState(mobj, mobj->state->nextstate);
+		mobj->fuse = mobj->info->speed;
+		if (mobj->spawnpoint)
+			mobj->fuse += (mobj->spawnpoint->angle / 360);
+		break;
+	case MT_NIGHTSCORE:
+		P_RemoveMobj(mobj);
+		return false;
+	case MT_LAVAFALL:
+		if (mobj->state - states == S_LAVAFALL_DORMANT)
+		{
+			mobj->fuse = 30;
+			P_SetMobjState(mobj, S_LAVAFALL_TELL);
+			S_StartSound(mobj, mobj->info->seesound);
+		}
+		else if (mobj->state - states == S_LAVAFALL_TELL)
+		{
+			mobj->fuse = 40;
+			P_SetMobjState(mobj, S_LAVAFALL_SHOOT);
+			S_StopSound(mobj);
+			S_StartSound(mobj, mobj->info->attacksound);
+		}
+		else
+		{
+			mobj->fuse = 30;
+			P_SetMobjState(mobj, S_LAVAFALL_DORMANT);
+			S_StopSound(mobj);
+		}
+		return false;
+	case MT_PYREFLY:
+		if (mobj->health <= 0)
 			break;
-		case MT_NIGHTSCORE:
-			P_RemoveMobj(mobj);
-			return false;
-		case MT_LAVAFALL:
-			if (mobj->state - states == S_LAVAFALL_DORMANT)
-			{
-				mobj->fuse = 30;
-				P_SetMobjState(mobj, S_LAVAFALL_TELL);
-				S_StartSound(mobj, mobj->info->seesound);
-			}
-			else if (mobj->state - states == S_LAVAFALL_TELL)
-			{
-				mobj->fuse = 40;
-				P_SetMobjState(mobj, S_LAVAFALL_SHOOT);
-				S_StopSound(mobj);
-				S_StartSound(mobj, mobj->info->attacksound);
-			}
-			else
-			{
-				mobj->fuse = 30;
-				P_SetMobjState(mobj, S_LAVAFALL_DORMANT);
-				S_StopSound(mobj);
-			}
-			return false;
-		case MT_PYREFLY:
-			if (mobj->health <= 0)
-				break;
 
-			mobj->extravalue2 = (mobj->extravalue2 + 1) % 3;
-			if (mobj->extravalue2 == 0)
-			{
-				P_SetMobjState(mobj, mobj->info->spawnstate);
-				mobj->fuse = 100;
-				S_StopSound(mobj);
-				S_StartSound(mobj, sfx_s3k8c);
-			}
-			else if (mobj->extravalue2 == 1)
-			{
-				mobj->fuse = 50;
-				S_StartSound(mobj, sfx_s3ka3);
-			}
-			else
-			{
-				P_SetMobjState(mobj, mobj->info->meleestate);
-				mobj->fuse = 100;
-				S_StopSound(mobj);
-				S_StartSound(mobj, sfx_s3kc2l);
-			}
-			return false;
-		case MT_PLAYER:
-			break; // don't remove
-		default:
-			P_SetMobjState(mobj, mobj->info->xdeathstate); // will remove the mobj if S_NULL.
-			break;
-			// Looking for monitors? They moved to a special condition above.
+		mobj->extravalue2 = (mobj->extravalue2 + 1) % 3;
+		if (mobj->extravalue2 == 0)
+		{
+			P_SetMobjState(mobj, mobj->info->spawnstate);
+			mobj->fuse = 100;
+			S_StopSound(mobj);
+			S_StartSound(mobj, sfx_s3k8c);
+		}
+		else if (mobj->extravalue2 == 1)
+		{
+			mobj->fuse = 50;
+			S_StartSound(mobj, sfx_s3ka3);
 		}
+		else
+		{
+			P_SetMobjState(mobj, mobj->info->meleestate);
+			mobj->fuse = 100;
+			S_StopSound(mobj);
+			S_StartSound(mobj, sfx_s3kc2l);
+		}
+		return false;
+	case MT_PLAYER:
+		break; // don't remove
+	default:
+		P_SetMobjState(mobj, mobj->info->xdeathstate); // will remove the mobj if S_NULL.
+		break;
+		// Looking for monitors? They moved to a special condition above.
+	}
 
 	return !P_MobjWasRemoved(mobj);
 }
@@ -10179,7 +10066,6 @@ void P_MobjThinker(mobj_t *mobj)
 		return;
 	}
 
-#ifdef HAVE_BLUA
 	// Check for a Lua thinker first
 	if (!mobj->player)
 	{
@@ -10193,7 +10079,7 @@ void P_MobjThinker(mobj_t *mobj)
 		if (P_MobjWasRemoved(mobj))
 			return;
 	}
-#endif
+
 	// if it's pushable, or if it would be pushable other than temporary disablement, use the
 	// separate thinker
 	if (mobj->flags & MF_PUSHABLE || (mobj->info->flags & MF_PUSHABLE && mobj->fuse))
@@ -10262,7 +10148,7 @@ void P_MobjThinker(mobj_t *mobj)
 		mobj->eflags &= ~MFE_JUSTHITFLOOR;
 	}
 
-#ifdef ESLOPE // Sliding physics for slidey mobjs!
+	// Sliding physics for slidey mobjs!
 	if (mobj->type == MT_FLINGRING
 		|| mobj->type == MT_FLINGCOIN
 		|| mobj->type == MT_FLINGBLUESPHERE
@@ -10277,7 +10163,6 @@ void P_MobjThinker(mobj_t *mobj)
 		//if (mobj->standingslope) CONS_Printf("slope physics on mobj\n");
 		P_ButteredSlope(mobj);
 	}
-#endif
 
 	if (mobj->flags & (MF_ENEMY|MF_BOSS) && mobj->health
 		&& P_CheckDeathPitCollide(mobj)) // extra pit check in case these didn't have momz
@@ -10611,15 +10496,11 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type)
 	// Make sure scale matches destscale immediately when spawned
 	P_SetScale(mobj, mobj->destscale);
 
-	mobj->floorz =
-#ifdef ESLOPE
-				mobj->subsector->sector->f_slope ? P_GetZAt(mobj->subsector->sector->f_slope, x, y) :
-#endif
+	mobj->floorz = mobj->subsector->sector->f_slope ?
+				P_GetZAt(mobj->subsector->sector->f_slope, x, y) :
 				mobj->subsector->sector->floorheight;
-	mobj->ceilingz =
-#ifdef ESLOPE
-				mobj->subsector->sector->c_slope ? P_GetZAt(mobj->subsector->sector->c_slope, x, y) :
-#endif
+	mobj->ceilingz = mobj->subsector->sector->c_slope ?
+				P_GetZAt(mobj->subsector->sector->c_slope, x, y) :
 				mobj->subsector->sector->ceilingheight;
 
 	mobj->floorrover = NULL;
@@ -10656,7 +10537,6 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type)
 	// Set shadowscale here, before spawn hook so that Lua can change it
 	mobj->shadowscale = P_DefaultMobjShadowScale(mobj);
 
-#ifdef HAVE_BLUA
 	// DANGER! This can cause P_SpawnMobj to return NULL!
 	// Avoid using P_RemoveMobj on the newly created mobj in "MobjSpawn" Lua hooks!
 	if (LUAh_MobjSpawn(mobj))
@@ -10667,7 +10547,6 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type)
 	else if (P_MobjWasRemoved(mobj))
 		return NULL;
 	else
-#endif
 	switch (mobj->type)
 	{
 		case MT_ALTVIEWMAN:
@@ -10937,9 +10816,7 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type)
 		{
 			var1 = st->var1;
 			var2 = st->var2;
-#ifdef HAVE_BLUA
 			astate = st;
-#endif
 			st->action.acp1(mobj);
 			// DANGER! This can cause P_SpawnMobj to return NULL!
 			// Avoid using MF_RUNSPAWNFUNC on mobjs whose spawn state expects target or tracer to already be set!
@@ -10977,15 +10854,11 @@ static precipmobj_t *P_SpawnPrecipMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype
 	// set subsector and/or block links
 	P_SetPrecipitationThingPosition(mobj);
 
-	mobj->floorz = starting_floorz =
-#ifdef ESLOPE
-				mobj->subsector->sector->f_slope ? P_GetZAt(mobj->subsector->sector->f_slope, x, y) :
-#endif
+	mobj->floorz = starting_floorz = mobj->subsector->sector->f_slope ?
+				P_GetZAt(mobj->subsector->sector->f_slope, x, y) :
 				mobj->subsector->sector->floorheight;
-	mobj->ceilingz =
-#ifdef ESLOPE
-				mobj->subsector->sector->c_slope ? P_GetZAt(mobj->subsector->sector->c_slope, x, y) :
-#endif
+	mobj->ceilingz = mobj->subsector->sector->c_slope ?
+				P_GetZAt(mobj->subsector->sector->c_slope, x, y) :
 				mobj->subsector->sector->ceilingheight;
 
 	mobj->floorrover = NULL;
@@ -11037,16 +10910,12 @@ size_t iquehead, iquetail;
 void P_RemoveMobj(mobj_t *mobj)
 {
 	I_Assert(mobj != NULL);
-#ifdef HAVE_BLUA
 	if (P_MobjWasRemoved(mobj))
 		return; // something already removing this mobj.
 
 	mobj->thinker.function.acp1 = (actionf_p1)P_RemoveThinkerDelayed; // shh. no recursing.
 	LUAh_MobjRemoved(mobj);
 	mobj->thinker.function.acp1 = (actionf_p1)P_MobjThinker; // needed for P_UnsetThingPosition, etc. to work.
-#else
-	I_Assert(!P_MobjWasRemoved(mobj));
-#endif
 
 	// Rings only, please!
 	if (mobj->spawnpoint &&
@@ -11625,16 +11494,12 @@ void P_MovePlayerToSpawn(INT32 playernum, mapthing_t *mthing)
 	// set Z height
 	sector = R_PointInSubsector(x, y)->sector;
 
-	floor =
-#ifdef ESLOPE
-	sector->f_slope ? P_GetZAt(sector->f_slope, x, y) :
-#endif
-	sector->floorheight;
-	ceiling =
-#ifdef ESLOPE
-	sector->c_slope ? P_GetZAt(sector->c_slope, x, y) :
-#endif
-	sector->ceilingheight;
+	floor = sector->f_slope ?
+		P_GetZAt(sector->f_slope, x, y) :
+		sector->floorheight;
+	ceiling = sector->c_slope ?
+		P_GetZAt(sector->c_slope, x, y) :
+		sector->ceilingheight;
 	ceilingspawn = ceiling - mobjinfo[MT_PLAYER].height;
 
 	if (mthing)
@@ -11704,16 +11569,12 @@ void P_MovePlayerToStarpost(INT32 playernum)
 	P_SetThingPosition(mobj);
 	sector = R_PointInSubsector(mobj->x, mobj->y)->sector;
 
-	floor =
-#ifdef ESLOPE
-	sector->f_slope ? P_GetZAt(sector->f_slope, mobj->x, mobj->y) :
-#endif
-	sector->floorheight;
-	ceiling =
-#ifdef ESLOPE
-	sector->c_slope ? P_GetZAt(sector->c_slope, mobj->x, mobj->y) :
-#endif
-	sector->ceilingheight;
+	floor = sector->f_slope ?
+		P_GetZAt(sector->f_slope, mobj->x, mobj->y) :
+		sector->floorheight;
+	ceiling = sector->c_slope ?
+		P_GetZAt(sector->c_slope, mobj->x, mobj->y) :
+		sector->ceilingheight;
 
 	z = p->starpostz << FRACBITS;
 
@@ -11762,17 +11623,11 @@ static fixed_t P_GetMobjSpawnHeight(const mobjtype_t mobjtype, const fixed_t x,
 
 	// Establish height.
 	if (flip)
-		return (
-#ifdef ESLOPE
-			ss->sector->c_slope ? P_GetZAt(ss->sector->c_slope, x, y) :
-#endif
-			ss->sector->ceilingheight) - offset - mobjinfo[mobjtype].height;
+		return (ss->sector->c_slope ? P_GetZAt(ss->sector->c_slope, x, y) : ss->sector->ceilingheight)
+			- offset - mobjinfo[mobjtype].height;
 	else
-		return (
-#ifdef ESLOPE
-			ss->sector->f_slope ? P_GetZAt(ss->sector->f_slope, x, y) :
-#endif
-			ss->sector->floorheight) + offset;
+		return (ss->sector->f_slope ? P_GetZAt(ss->sector->f_slope, x, y) : ss->sector->floorheight)
+			+ offset;
 }
 
 static fixed_t P_GetMapThingSpawnHeight(const mobjtype_t mobjtype, const mapthing_t* mthing, const fixed_t x, const fixed_t y)
@@ -12710,7 +12565,6 @@ static boolean P_SetupBooster(mapthing_t* mthing, mobj_t* mobj, boolean strong)
 
 static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj, boolean *doangle)
 {
-#ifdef HAVE_BLUA
 	boolean override = LUAh_MapThingSpawn(mobj, mthing);
 
 	if (P_MobjWasRemoved(mobj))
@@ -12718,7 +12572,6 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj, boolean
 
 	if (override)
 		return true;
-#endif
 
 	switch (mobj->type)
 	{
diff --git a/src/p_mobj.h b/src/p_mobj.h
index 63c91571bc082830e082693273054cd5d3686f17..5deb288e42c8969a336ab119d37f88c3fb9a9876 100644
--- a/src/p_mobj.h
+++ b/src/p_mobj.h
@@ -370,9 +370,7 @@ typedef struct mobj_s
 	INT32 cusval;
 	INT32 cvmem;
 
-#ifdef ESLOPE
 	struct pslope_s *standingslope; // The slope that the object is standing on (shouldn't need synced in savegames, right?)
-#endif
 
 	boolean colorized; // Whether the mobj uses the rainbow colormap
 	fixed_t shadowscale; // If this object casts a shadow, and the size relative to radius
diff --git a/src/p_saveg.c b/src/p_saveg.c
index 90df2726c54694fab9bc8c425ad51859d23d2a6d..71650a4babf05727942cec993f0df911719fc55d 100644
--- a/src/p_saveg.c
+++ b/src/p_saveg.c
@@ -22,7 +22,7 @@
 #include "p_setup.h"
 #include "p_saveg.h"
 #include "r_data.h"
-#include "r_things.h"
+#include "r_skins.h"
 #include "r_state.h"
 #include "w_wad.h"
 #include "y_inter.h"
@@ -31,9 +31,7 @@
 #include "r_sky.h"
 #include "p_polyobj.h"
 #include "lua_script.h"
-#ifdef ESLOPE
 #include "p_slopes.h"
-#endif
 
 savedata_t savedata;
 UINT8 *save_p;
@@ -1333,9 +1331,7 @@ typedef enum
 	MD2_HPREV       = 1<<8,
 	MD2_FLOORROVER  = 1<<9,
 	MD2_CEILINGROVER = 1<<10,
-#ifdef ESLOPE
 	MD2_SLOPE        = 1<<11,
-#endif
 	MD2_COLORIZED    = 1<<12,
 	MD2_ROLLANGLE    = 1<<13,
 	MD2_SHADOWSCALE  = 1<<14,
@@ -1375,10 +1371,8 @@ typedef enum
 	tc_fade,
 	tc_fadecolormap,
 	tc_planedisplace,
-#ifdef ESLOPE
 	tc_dynslopeline,
 	tc_dynslopevert,
-#endif // ESLOPE
 #ifdef POLYOBJECTS
 	tc_polyrotate, // haleyjd 03/26/06: polyobjects
 	tc_polymove,
@@ -1417,13 +1411,11 @@ static inline UINT32 SavePlayer(const player_t *player)
 	return 0xFFFFFFFF;
 }
 
-#ifdef ESLOPE
 static UINT32 SaveSlope(const pslope_t *slope)
 {
 	if (slope) return (UINT32)(slope->id);
 	return 0xFFFFFFFF;
 }
-#endif // ESLOPE
 
 //
 // SaveMobjThinker
@@ -1552,10 +1544,8 @@ static void SaveMobjThinker(const thinker_t *th, const UINT8 type)
 		diff2 |= MD2_FLOORROVER;
 	if (mobj->ceilingrover)
 		diff2 |= MD2_CEILINGROVER;
-#ifdef ESLOPE
 	if (mobj->standingslope)
 		diff2 |= MD2_SLOPE;
-#endif
 	if (mobj->colorized)
 		diff2 |= MD2_COLORIZED;
 	if (mobj->rollangle)
@@ -1720,10 +1710,8 @@ static void SaveMobjThinker(const thinker_t *th, const UINT8 type)
 		WRITEUINT32(save_p, mobj->hnext->mobjnum);
 	if (diff2 & MD2_HPREV)
 		WRITEUINT32(save_p, mobj->hprev->mobjnum);
-#ifdef ESLOPE
 	if (diff2 & MD2_SLOPE)
 		WRITEUINT16(save_p, mobj->standingslope->id);
-#endif
 	if (diff2 & MD2_COLORIZED)
 		WRITEUINT8(save_p, mobj->colorized);
 	if (diff2 & MD2_ROLLANGLE)
@@ -2074,7 +2062,7 @@ static void SavePlaneDisplaceThinker(const thinker_t *th, const UINT8 type)
 	WRITEFIXED(save_p, ht->speed);
 	WRITEUINT8(save_p, ht->type);
 }
-#ifdef ESLOPE
+
 /// Save a dynamic slope thinker.
 static inline void SaveDynamicSlopeThinker(const thinker_t *th, const UINT8 type)
 {
@@ -2089,7 +2077,6 @@ static inline void SaveDynamicSlopeThinker(const thinker_t *th, const UINT8 type
 	WRITEMEM(save_p, ht->tags, sizeof(ht->tags));
     WRITEMEM(save_p, ht->vex, sizeof(ht->vex));
 }
-#endif // ESLOPE
 
 #ifdef POLYOBJECTS
 
@@ -2472,7 +2459,6 @@ static void P_NetArchiveThinkers(void)
 				continue;
 			}
 #endif
-#ifdef ESLOPE
 			else if (th->function.acp1 == (actionf_p1)T_DynamicSlopeLine)
 			{
 				SaveDynamicSlopeThinker(th, tc_dynslopeline);
@@ -2483,7 +2469,6 @@ static void P_NetArchiveThinkers(void)
 				SaveDynamicSlopeThinker(th, tc_dynslopevert);
 				continue;
 			}
-#endif // ESLOPE
 #ifdef PARANOIA
 			else if (th->function.acp1 != (actionf_p1)P_RemoveThinkerDelayed) // wait garbage collection
 				I_Error("unknown thinker type %p", th->function.acp1);
@@ -2544,7 +2529,6 @@ static inline player_t *LoadPlayer(UINT32 player)
 	return &players[player];
 }
 
-#ifdef ESLOPE
 static inline pslope_t *LoadSlope(UINT32 slopeid)
 {
 	pslope_t *p = slopelist;
@@ -2556,7 +2540,6 @@ static inline pslope_t *LoadSlope(UINT32 slopeid)
 	} while ((p = p->next));
 	return NULL;
 }
-#endif // ESLOPE
 
 //
 // LoadMobjThinker
@@ -2801,10 +2784,8 @@ static thinker_t* LoadMobjThinker(actionf_p1 thinker)
 		mobj->hnext = (mobj_t *)(size_t)READUINT32(save_p);
 	if (diff2 & MD2_HPREV)
 		mobj->hprev = (mobj_t *)(size_t)READUINT32(save_p);
-#ifdef ESLOPE
 	if (diff2 & MD2_SLOPE)
 		mobj->standingslope = P_SlopeById(READUINT16(save_p));
-#endif
 	if (diff2 & MD2_COLORIZED)
 		mobj->colorized = READUINT8(save_p);
 	if (diff2 & MD2_ROLLANGLE)
@@ -3264,7 +3245,6 @@ static inline thinker_t* LoadPlaneDisplaceThinker(actionf_p1 thinker)
 	return &ht->thinker;
 }
 
-#ifdef ESLOPE
 /// Save a dynamic slope thinker.
 static inline thinker_t* LoadDynamicSlopeThinker(actionf_p1 thinker)
 {
@@ -3279,7 +3259,6 @@ static inline thinker_t* LoadDynamicSlopeThinker(actionf_p1 thinker)
 	READMEM(save_p, ht->vex, sizeof(ht->vex));
 	return &ht->thinker;
 }
-#endif // ESLOPE
 
 #ifdef POLYOBJECTS
 
@@ -3659,7 +3638,7 @@ static void P_NetUnArchiveThinkers(void)
 					th = LoadPolyfadeThinker((actionf_p1)T_PolyObjFade);
 					break;
 #endif
-#ifdef ESLOPE
+
 				case tc_dynslopeline:
 					th = LoadDynamicSlopeThinker((actionf_p1)T_DynamicSlopeLine);
 					break;
@@ -3667,7 +3646,6 @@ static void P_NetUnArchiveThinkers(void)
 				case tc_dynslopevert:
 					th = LoadDynamicSlopeThinker((actionf_p1)T_DynamicSlopeVert);
 					break;
-#endif // ESLOPE
 
 				case tc_scroll:
 					th = LoadScrollThinker((actionf_p1)T_Scroll);
@@ -4264,8 +4242,6 @@ void P_SaveGame(void)
 {
 	P_ArchiveMisc();
 	P_ArchivePlayer();
-
-	// yes, even in non HAVE_BLUA
 	P_ArchiveLuabanksAndConsistency();
 }
 
@@ -4301,9 +4277,7 @@ void P_SaveNetGame(void)
 		P_NetArchiveSpecials();
 		P_NetArchiveColormaps();
 	}
-#ifdef HAVE_BLUA
 	LUA_Archive();
-#endif
 
 	P_ArchiveLuabanksAndConsistency();
 }
@@ -4345,9 +4319,7 @@ boolean P_LoadNetGame(void)
 		P_RelinkPointers();
 		P_FinishMobjs();
 	}
-#ifdef HAVE_BLUA
 	LUA_UnArchive();
-#endif
 
 	// This is stupid and hacky, but maybe it'll work!
 	P_SetRandSeed(P_GetInitSeed());
diff --git a/src/p_setup.c b/src/p_setup.c
index 6f4d1c3171a723fb14d5e389ab9223dc23a0aee9..8ecfceeae089d86a674edc9aad0049beac05c653 100644
--- a/src/p_setup.c
+++ b/src/p_setup.c
@@ -27,7 +27,7 @@
 #include "i_system.h"
 
 #include "r_data.h"
-#include "r_things.h"
+#include "r_things.h" // for R_AddSpriteDefs
 #include "r_patch.h"
 #include "r_sky.h"
 #include "r_draw.h"
@@ -57,9 +57,7 @@
 
 #include "filesrch.h" // refreshdirmenu
 
-#ifdef HAVE_BLUA
 #include "lua_hud.h" // level title
-#endif
 
 #include "f_finale.h" // wipes
 
@@ -79,9 +77,7 @@
 #include "hardware/hw_model.h"
 #endif
 
-#ifdef ESLOPE
 #include "p_slopes.h"
-#endif
 
 #include "fastcmp.h" // textmap parsing
 
@@ -912,11 +908,9 @@ static void P_InitializeSector(sector_t *ss)
 	ss->preciplist = NULL;
 	ss->touching_preciplist = NULL;
 
-#ifdef ESLOPE
 	ss->f_slope = NULL;
 	ss->c_slope = NULL;
 	ss->hasslope = false;
-#endif
 
 	ss->spawn_lightlevel = ss->lightlevel;
 
@@ -3973,9 +3967,7 @@ boolean P_LoadLevel(boolean fromnetsave)
 	// Close text prompt before freeing the old level
 	F_EndTextPrompt(false, true);
 
-#ifdef HAVE_BLUA
 	LUA_InvalidateLevel();
-#endif
 
 	for (ss = sectors; sectors+numsectors != ss; ss++)
 	{
@@ -4031,9 +4023,7 @@ boolean P_LoadLevel(boolean fromnetsave)
 	// anything that P_SpawnSlopes/P_LoadThings needs to know
 	P_InitSpecials();
 
-#ifdef ESLOPE
 	P_SpawnSlopes(fromnetsave);
-#endif
 
 	P_SpawnMapThings(!fromnetsave);
 	skyboxmo[0] = skyboxviewpnts[0];
@@ -4112,9 +4102,7 @@ boolean P_LoadLevel(boolean fromnetsave)
 				G_CopyTiccmd(&players[i].cmd, &netcmds[buf][i], 1);
 		}
 		P_PreTicker(2);
-#ifdef HAVE_BLUA
 		LUAh_MapLoad();
-#endif
 	}
 
 	// No render mode, stop here.
@@ -4306,10 +4294,8 @@ boolean P_AddWadFile(const char *wadfilename)
 
 		// Update the detected resources.
 		// Note: ALWAYS load Lua scripts first, SOCs right after, and the remaining resources afterwards.
-#ifdef HAVE_BLUA
 //		if (luaNum) // Lua scripts.
 //			P_LoadLuaScrRange(wadnum, luaPos, luaNum);
-#endif
 //		if (socNum) // SOCs.
 //			P_LoadDehackRange(wadnum, socPos, socNum);
 		if (sfxNum) // Sounds. TODO: Function currently only updates already existing sounds, the rest is handled somewhere else.
diff --git a/src/p_sight.c b/src/p_sight.c
index 4ea14cca0ea7286bad2d779617f179748ea5e6cc..c9083b99b9f3bc0bd2b7fe4b7ee1573238a3c56f 100644
--- a/src/p_sight.c
+++ b/src/p_sight.c
@@ -218,9 +218,7 @@ static boolean P_CrossSubsector(size_t num, register los_t *los)
 		const vertex_t *v1,*v2;
 		fixed_t frac;
 		fixed_t frontf, backf, frontc, backc;
-#ifdef ESLOPE
 		fixed_t fracx, fracy;
-#endif
 
 		if (seg->glseg)
 			continue;
@@ -263,7 +261,6 @@ static boolean P_CrossSubsector(size_t num, register los_t *los)
 
 		front = seg->frontsector;
 		back  = seg->backsector;
-#ifdef ESLOPE
 		// calculate position at intercept
 		fracx = los->strace.x + FixedMul(los->strace.dx, frac);
 		fracy = los->strace.y + FixedMul(los->strace.dy, frac);
@@ -272,12 +269,6 @@ static boolean P_CrossSubsector(size_t num, register los_t *los)
 		frontc = (front->c_slope) ? P_GetZAt(front->c_slope, fracx, fracy) : front->ceilingheight;
 		backf  = (back->f_slope)  ? P_GetZAt(back->f_slope, fracx, fracy)  : back->floorheight;
 		backc  = (back->c_slope)  ? P_GetZAt(back->c_slope, fracx, fracy)  : back->ceilingheight;
-#else
-		frontf = front->floorheight;
-		frontc = front->ceilingheight;
-		backf  = back->floorheight;
-		backc  = back->ceilingheight;
-#endif
 		// crosses a two sided line
 		// no wall to block sight with?
 		if (frontf == backf && frontc == backc
@@ -327,13 +318,8 @@ static boolean P_CrossSubsector(size_t num, register los_t *los)
 					continue;
 				}
 
-#ifdef ESLOPE
 				topz    = (*rover->t_slope) ? P_GetZAt(*rover->t_slope, fracx, fracy) : *rover->topheight;
 				bottomz = (*rover->b_slope) ? P_GetZAt(*rover->b_slope, fracx, fracy) : *rover->bottomheight;
-#else
-				topz    = *rover->topheight;
-				bottomz = *rover->bottomheight;
-#endif
 				topslope    = FixedDiv(topz - los->sightzstart , frac);
 				bottomslope = FixedDiv(bottomz - los->sightzstart , frac);
 				if (topslope >= los->topslope && bottomslope <= los->bottomslope)
@@ -348,13 +334,8 @@ static boolean P_CrossSubsector(size_t num, register los_t *los)
 					continue;
 				}
 
-#ifdef ESLOPE
 				topz    = (*rover->t_slope) ? P_GetZAt(*rover->t_slope, fracx, fracy) : *rover->topheight;
 				bottomz = (*rover->b_slope) ? P_GetZAt(*rover->b_slope, fracx, fracy) : *rover->bottomheight;
-#else
-				topz    = *rover->topheight;
-				bottomz = *rover->bottomheight;
-#endif
 				topslope    = FixedDiv(topz - los->sightzstart , frac);
 				bottomslope = FixedDiv(bottomz - los->sightzstart , frac);
 				if (topslope >= los->topslope && bottomslope <= los->bottomslope)
@@ -487,7 +468,6 @@ boolean P_CheckSight(mobj_t *t1, mobj_t *t2)
 				continue;
 			}
 
-#ifdef ESLOPE
 			if (*rover->t_slope)
 			{
 				topz1 = P_GetZAt(*rover->t_slope, t1->x, t1->y);
@@ -503,10 +483,6 @@ boolean P_CheckSight(mobj_t *t1, mobj_t *t2)
 			}
 			else
 				bottomz1 = bottomz2 = *rover->bottomheight;
-#else
-			topz1 = topz2 = *rover->topheight;
-			bottomz1 = bottomz2 = *rover->bottomheight;
-#endif
 
 			// Check for blocking floors here.
 			if ((los.sightzstart < bottomz1 && t2->z >= topz2)
diff --git a/src/p_slopes.c b/src/p_slopes.c
index 49998b9c0a8ad928657618fd2719dd0a91ec8641..c4ef286661347c315e256e57118e475b6219ee1b 100644
--- a/src/p_slopes.c
+++ b/src/p_slopes.c
@@ -23,8 +23,6 @@
 #include "p_maputl.h"
 #include "w_wad.h"
 
-#ifdef ESLOPE
-
 pslope_t *slopelist = NULL;
 UINT16 slopecount = 0;
 
@@ -869,6 +867,3 @@ void P_ButteredSlope(mobj_t *mo)
 
 	P_Thrust(mo, mo->standingslope->xydirection, thrust);
 }
-
-// EOF
-#endif // #ifdef ESLOPE
diff --git a/src/p_slopes.h b/src/p_slopes.h
index f8159b88423f76d6367b8dc36496e0417a1ba6fc..e7c850ab811e33c19cca5700453472f3804d4c56 100644
--- a/src/p_slopes.h
+++ b/src/p_slopes.h
@@ -15,8 +15,6 @@
 
 #include "m_fixed.h" // Vectors
 
-#ifdef ESLOPE
-
 extern pslope_t *slopelist;
 extern UINT16 slopecount;
 
@@ -74,5 +72,4 @@ typedef struct
 
 void T_DynamicSlopeLine (dynplanethink_t* th);
 void T_DynamicSlopeVert (dynplanethink_t* th);
-#endif // #ifdef ESLOPE
 #endif // #ifndef P_SLOPES_H__
diff --git a/src/p_spec.c b/src/p_spec.c
index a558499bedca67da0dc93ee6ff0983d04e2f2259..95addfbb836c62db8f6bfd2e32a0892999e12d34 100644
--- a/src/p_spec.c
+++ b/src/p_spec.c
@@ -36,7 +36,7 @@
 #include "m_cond.h" //unlock triggers
 #include "lua_hook.h" // LUAh_LinedefExecute
 #include "f_finale.h" // control text prompt
-#include "r_things.h" // skins
+#include "r_skins.h" // skins
 
 #ifdef HW3SOUND
 #include "hardware/hw3sound.h"
@@ -3366,14 +3366,10 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
 		}
 
 		case 443: // Calls a named Lua function
-#ifdef HAVE_BLUA
 			if (line->stringargs[0])
 				LUAh_LinedefExecute(line, mo, callsec);
 			else
 				CONS_Alert(CONS_WARNING, "Linedef %s is missing the hook name of the Lua function to call! (This should be given in arg0str)\n", sizeu1(line-lines));
-#else
-			CONS_Alert(CONS_ERROR, "The map is trying to run a Lua script, but this exe was not compiled with Lua support!\n");
-#endif
 			break;
 
 		case 444: // Earthquake camera
@@ -5810,7 +5806,6 @@ static ffloor_t *P_AddFakeFloor(sector_t *sec, sector_t *sec2, line_t *master, f
 	fflr->topyoffs = &sec2->ceiling_yoffs;
 	fflr->topangle = &sec2->ceilingpic_angle;
 
-#ifdef ESLOPE
 	// Add slopes
 	fflr->t_slope = &sec2->c_slope;
 	fflr->b_slope = &sec2->f_slope;
@@ -5818,7 +5813,6 @@ static ffloor_t *P_AddFakeFloor(sector_t *sec, sector_t *sec2, line_t *master, f
 	// (this fixes FOF slopes glitching initially at level load in software mode)
 	if (sec2->hasslope)
 		sec->hasslope = true;
-#endif
 
 	// \todo Remove once all FOFs are adapted
 	if ((flags & FF_SOLID) && (master->flags & ML_EFFECT1)) // Block player only
@@ -6287,15 +6281,11 @@ void T_LaserFlash(laserthink_t *flash)
 
 	sourcesec = fflr->master->frontsector; // Less to type!
 
-#ifdef ESLOPE
 	top = (*fflr->t_slope) ? P_GetZAt(*fflr->t_slope, sector->soundorg.x, sector->soundorg.y)
 			: *fflr->topheight;
 	bottom = (*fflr->b_slope) ? P_GetZAt(*fflr->b_slope, sector->soundorg.x, sector->soundorg.y)
 			: *fflr->bottomheight;
 	sector->soundorg.z = (top + bottom)/2;
-#else
-	sector->soundorg.z = (*fflr->topheight + *fflr->bottomheight)/2;
-#endif
 	S_StartSound(&sector->soundorg, sfx_laser);
 
 	// Seek out objects to DESTROY! MUAHAHHAHAHAA!!!*cough*
@@ -7837,12 +7827,10 @@ void T_Disappear(disappear_t *d)
 
 					if (!(lines[d->sourceline].flags & ML_NOCLIMB))
 					{
-#ifdef ESLOPE
 						if (*rover->t_slope)
 							sectors[s].soundorg.z = P_GetZAt(*rover->t_slope, sectors[s].soundorg.x, sectors[s].soundorg.y);
 						else
-#endif
-						sectors[s].soundorg.z = *rover->topheight;
+							sectors[s].soundorg.z = *rover->topheight;
 						S_StartSound(&sectors[s].soundorg, sfx_appear);
 					}
 				}
diff --git a/src/p_tick.c b/src/p_tick.c
index 1d421ad37c1686f5db2a5b1cb58306e2695e75fb..7ea6edb2d5c4090f996e9ad6e1ff744ccb1e97b5 100644
--- a/src/p_tick.c
+++ b/src/p_tick.c
@@ -269,9 +269,7 @@ void P_RemoveThinkerDelayed(thinker_t *thinker)
 //
 void P_RemoveThinker(thinker_t *thinker)
 {
-#ifdef HAVE_BLUA
 	LUA_InvalidateUserdata(thinker);
-#endif
 	thinker->function.acp1 = (actionf_p1)P_RemoveThinkerDelayed;
 }
 
@@ -643,9 +641,7 @@ void P_Ticker(boolean run)
 		if (demoplayback)
 			G_ReadDemoTiccmd(&players[consoleplayer].cmd, 0);
 
-		#ifdef HAVE_BLUA
 		LUAh_PreThinkFrame();
-		#endif
 
 		for (i = 0; i < MAXPLAYERS; i++)
 			if (playeringame[i] && players[i].mo && !P_MobjWasRemoved(players[i].mo))
@@ -671,9 +667,7 @@ void P_Ticker(boolean run)
 			if (playeringame[i] && players[i].mo && !P_MobjWasRemoved(players[i].mo))
 				P_PlayerAfterThink(&players[i]);
 
-#ifdef HAVE_BLUA
 		LUAh_ThinkFrame();
-#endif
 	}
 
 	// Run shield positioning
@@ -745,9 +739,7 @@ void P_Ticker(boolean run)
 		if (modeattacking)
 			G_GhostTicker();
 
-#ifdef HAVE_BLUA
 		LUAh_PostThinkFrame();
-#endif
 	}
 
 	P_MapEnd();
@@ -767,9 +759,8 @@ void P_PreTicker(INT32 frames)
 	{
 		P_MapStart();
 
-#ifdef HAVE_BLUA
 		LUAh_PreThinkFrame();
-#endif
+
 		for (i = 0; i < MAXPLAYERS; i++)
 			if (playeringame[i] && players[i].mo && !P_MobjWasRemoved(players[i].mo))
 			{
@@ -793,9 +784,7 @@ void P_PreTicker(INT32 frames)
 			if (playeringame[i] && players[i].mo && !P_MobjWasRemoved(players[i].mo))
 				P_PlayerAfterThink(&players[i]);
 
-#ifdef HAVE_BLUA
 		LUAh_ThinkFrame();
-#endif
 
 		// Run shield positioning
 		P_RunShields();
@@ -804,9 +793,7 @@ void P_PreTicker(INT32 frames)
 		P_UpdateSpecials();
 		P_RespawnSpecials();
 
-#ifdef HAVE_BLUA
 		LUAh_PostThinkFrame();
-#endif
 
 		P_MapEnd();
 	}
diff --git a/src/p_user.c b/src/p_user.c
index 9167d5345049324b83d41f813e0d619b1443bc99..c12bc0c5983d9cebf20091a78fb17c890e48d2a9 100644
--- a/src/p_user.c
+++ b/src/p_user.c
@@ -22,7 +22,7 @@
 #include "p_local.h"
 #include "r_main.h"
 #include "s_sound.h"
-#include "r_things.h"
+#include "r_skins.h"
 #include "d_think.h"
 #include "r_sky.h"
 #include "p_setup.h"
@@ -395,7 +395,7 @@ void P_GiveFinishFlags(player_t *player)
 		mobj_t* flag = P_SpawnMobjFromMobj(player->mo, xoffs, yoffs, 0, MT_FINISHFLAG);
 		flag->angle = angle;
 		angle += FixedAngle(120*FRACUNIT);
-		
+
 		P_SetTarget(&flag->target, player->mo);
 	}
 }
@@ -1109,7 +1109,6 @@ boolean P_PlayerCanDamage(player_t *player, mobj_t *thing)
 	if (!player->mo || player->spectator || !thing || P_MobjWasRemoved(thing))
 		return false;
 
-#ifdef HAVE_BLUA
 	{
 		UINT8 shouldCollide = LUAh_PlayerCanDamage(player, thing);
 		if (P_MobjWasRemoved(thing))
@@ -1119,7 +1118,6 @@ boolean P_PlayerCanDamage(player_t *player, mobj_t *thing)
 		else if (shouldCollide == 2)
 			return false; // force no
 	}
-#endif
 
 	// Invinc/super. Not for Monitors.
 	if (!(thing->flags & MF_MONITOR) && (player->powers[pw_invulnerability] || player->powers[pw_super]))
@@ -1521,7 +1519,7 @@ void P_PlayJingle(player_t *player, jingletype_t jingletype)
 
 	char newmusic[7];
 	strncpy(newmusic, musname, 7);
-#if defined(HAVE_BLUA) && defined(HAVE_LUA_MUSICPLUS)
+#ifdef HAVE_LUA_MUSICPLUS
  	if(LUAh_MusicJingle(jingletype, newmusic, &musflags, &looping))
  		return;
 #endif
@@ -1536,7 +1534,7 @@ void P_PlayJingle(player_t *player, jingletype_t jingletype)
 void P_PlayJingleMusic(player_t *player, const char *musname, UINT16 musflags, boolean looping, UINT16 status)
 {
 	// If gamestate != GS_LEVEL, always play the jingle (1-up intermission)
-	if (gamestate == GS_LEVEL && !P_IsLocalPlayer(player))
+	if (gamestate == GS_LEVEL && player && !P_IsLocalPlayer(player))
 		return;
 
 	S_RetainMusic(musname, musflags, looping, 0, status);
@@ -1544,7 +1542,7 @@ void P_PlayJingleMusic(player_t *player, const char *musname, UINT16 musflags, b
 	S_ChangeMusicInternal(musname, looping);
 }
 
-boolean P_EvaluateMusicStatus(UINT16 status)
+boolean P_EvaluateMusicStatus(UINT16 status, const char *musname)
 {
 	// \todo lua hook
 	int i;
@@ -1601,8 +1599,11 @@ boolean P_EvaluateMusicStatus(UINT16 status)
 				result = (players[i].nightstime && players[i].nightstime <= 10*TICRATE);
 				break;
 
-			case JT_NONE:   // Null state
 			case JT_OTHER:  // Other state
+				result = LUAh_ShouldJingleContinue(&players[i], musname);
+				break;
+
+			case JT_NONE:   // Null state
 			case JT_MASTER: // Main level music
 			default:
 				result = true;
@@ -1865,10 +1866,8 @@ void P_SpawnShieldOrb(player_t *player)
 		I_Error("P_SpawnShieldOrb: player->mo is NULL!\n");
 #endif
 
-#ifdef HAVE_BLUA
 	if (LUAh_ShieldSpawn(player))
 		return;
-#endif
 
 	if (player->powers[pw_shield] & SH_FORCE)
 		orbtype = MT_FORCE_ORB;
@@ -2275,13 +2274,8 @@ boolean P_InSpaceSector(mobj_t *mo) // Returns true if you are in space
 
 			if (GETSECSPECIAL(rover->master->frontsector->special, 1) != SPACESPECIAL)
 				continue;
-#ifdef ESLOPE
 			topheight = *rover->t_slope ? P_GetZAt(*rover->t_slope, mo->x, mo->y) : *rover->topheight;
 			bottomheight = *rover->b_slope ? P_GetZAt(*rover->b_slope, mo->x, mo->y) : *rover->bottomheight;
-#else
-			topheight = *rover->topheight;
-			bottomheight = *rover->bottomheight;
-#endif
 
 			if (mo->z + (mo->height/2) > topheight)
 				continue;
@@ -2518,13 +2512,8 @@ boolean P_InQuicksand(mobj_t *mo) // Returns true if you are in quicksand
 			if (!(rover->flags & FF_QUICKSAND))
 				continue;
 
-#ifdef ESLOPE
 			topheight = *rover->t_slope ? P_GetZAt(*rover->t_slope, mo->x, mo->y) : *rover->topheight;
 			bottomheight = *rover->b_slope ? P_GetZAt(*rover->b_slope, mo->x, mo->y) : *rover->bottomheight;
-#else
-			topheight = *rover->topheight;
-			bottomheight = *rover->bottomheight;
-#endif
 
 			if (mo->z + flipoffset > topheight)
 				continue;
@@ -2694,9 +2683,7 @@ static void P_CheckBouncySectors(player_t *player)
 	fixed_t oldx;
 	fixed_t oldy;
 	fixed_t oldz;
-#ifdef ESLOPE
 	vector3_t momentum;
-#endif
 
 	oldx = player->mo->x;
 	oldy = player->mo->y;
@@ -2751,7 +2738,6 @@ static void P_CheckBouncySectors(player_t *player)
 					{
 						fixed_t newmom;
 
-#ifdef ESLOPE
 						pslope_t *slope;
 						if (abs(oldz - topheight) < abs(oldz + player->mo->height - bottomheight)) { // Hit top
 							slope = *rover->t_slope;
@@ -2767,9 +2753,6 @@ static void P_CheckBouncySectors(player_t *player)
 							P_ReverseQuantizeMomentumToSlope(&momentum, slope);
 
 						newmom = momentum.z = -FixedMul(momentum.z,linedist)/2;
-#else
-						newmom = -FixedMul(player->mo->momz,linedist);
-#endif
 
 						if (abs(newmom) < (linedist*2))
 						{
@@ -2792,7 +2775,6 @@ static void P_CheckBouncySectors(player_t *player)
 						else if (newmom < -P_GetPlayerHeight(player)/2)
 							newmom = -P_GetPlayerHeight(player)/2;
 
-#ifdef ESLOPE
 						momentum.z = newmom*2;
 
 						if (slope)
@@ -2801,9 +2783,6 @@ static void P_CheckBouncySectors(player_t *player)
 						player->mo->momx = momentum.x;
 						player->mo->momy = momentum.y;
 						player->mo->momz = momentum.z/2;
-#else
-						player->mo->momz = newmom;
-#endif
 
 						if (player->pflags & PF_SPINNING)
 						{
@@ -2860,13 +2839,8 @@ static void P_CheckQuicksand(player_t *player)
 		if (!(rover->flags & FF_QUICKSAND))
 			continue;
 
-#ifdef ESLOPE
 		topheight = *rover->t_slope ? P_GetZAt(*rover->t_slope, player->mo->x, player->mo->y) : *rover->topheight;
 		bottomheight = *rover->b_slope ? P_GetZAt(*rover->b_slope, player->mo->x, player->mo->y) : *rover->bottomheight;
-#else
-		topheight = *rover->topheight;
-		bottomheight = *rover->bottomheight;
-#endif
 
 		if (topheight >= player->mo->z && bottomheight < player->mo->z + player->mo->height)
 		{
@@ -3200,26 +3174,21 @@ static void P_DoClimbing(player_t *player)
 		boolean thrust = false;
 		boolean boostup = false;
 		boolean skyclimber = false;
-		fixed_t floorheight, ceilingheight; // ESLOPE
+		fixed_t floorheight, ceilingheight;
 
 		if (!glidesector)
 			floorclimb = true;
 		else
 		{
-#ifdef ESLOPE
 			floorheight = glidesector->sector->f_slope ? P_GetZAt(glidesector->sector->f_slope, player->mo->x, player->mo->y)
 													   : glidesector->sector->floorheight;
 			ceilingheight = glidesector->sector->c_slope ? P_GetZAt(glidesector->sector->c_slope, player->mo->x, player->mo->y)
 														 : glidesector->sector->ceilingheight;
-#else
-			floorheight = glidesector->sector->floorheight;
-			ceilingheight = glidesector->sector->ceilingheight;
-#endif
 
 			if (glidesector->sector->ffloors)
 			{
 				ffloor_t *rover;
-				fixed_t topheight, bottomheight; // ESLOPE
+				fixed_t topheight, bottomheight;
 
 				for (rover = glidesector->sector->ffloors; rover; rover = rover->next)
 				{
@@ -3228,13 +3197,8 @@ static void P_DoClimbing(player_t *player)
 
 					floorclimb = true;
 
-#ifdef ESLOPE
 					topheight = *rover->t_slope ? P_GetZAt(*rover->t_slope, player->mo->x, player->mo->y) : *rover->topheight;
 					bottomheight = *rover->b_slope ? P_GetZAt(*rover->b_slope, player->mo->x, player->mo->y) : *rover->bottomheight;
-#else
-					topheight = *rover->topheight;
-					bottomheight = *rover->bottomheight;
-#endif
 
 					// Only supports rovers that are moving like an 'elevator', not just the top or bottom.
 					if (rover->master->frontsector->floorspeed && rover->master->frontsector->ceilspeed == 42)
@@ -3275,11 +3239,7 @@ static void P_DoClimbing(player_t *player)
 								if (roverbelow == rover)
 									continue;
 
-#ifdef ESLOPE
 								bottomheight2 = *roverbelow->b_slope ? P_GetZAt(*roverbelow->b_slope, player->mo->x, player->mo->y) : *roverbelow->bottomheight;
-#else
-								bottomheight2 = *roverbelow->bottomheight;
-#endif
 
 								if (bottomheight2 < topheight + FixedMul(16*FRACUNIT, player->mo->scale))
 									foundfof = true;
@@ -3325,11 +3285,7 @@ static void P_DoClimbing(player_t *player)
 								if (roverbelow == rover)
 									continue;
 
-#ifdef ESLOPE
 								topheight2 = *roverbelow->t_slope ? P_GetZAt(*roverbelow->t_slope, player->mo->x, player->mo->y) : *roverbelow->topheight;
-#else
-								topheight2 = *roverbelow->topheight;
-#endif
 
 								if (topheight2 > bottomheight - FixedMul(16*FRACUNIT, player->mo->scale))
 									foundfof = true;
@@ -3384,11 +3340,7 @@ static void P_DoClimbing(player_t *player)
 							if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_BLOCKPLAYER) || (rover->flags & FF_BUSTUP))
 								continue;
 
-#ifdef ESLOPE
 							bottomheight = *rover->b_slope ? P_GetZAt(*rover->b_slope, player->mo->x, player->mo->y) : *rover->bottomheight;
-#else
-							bottomheight = *rover->bottomheight;
-#endif
 
 							if (bottomheight < floorheight + FixedMul(16*FRACUNIT, player->mo->scale))
 							{
@@ -3429,11 +3381,7 @@ static void P_DoClimbing(player_t *player)
 							if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_BLOCKPLAYER) || (rover->flags & FF_BUSTUP))
 								continue;
 
-#ifdef ESLOPE
 							topheight = *rover->t_slope ? P_GetZAt(*rover->t_slope, player->mo->x, player->mo->y) : *rover->topheight;
-#else
-							topheight = *rover->topheight;
-#endif
 
 							if (topheight > ceilingheight - FixedMul(16*FRACUNIT, player->mo->scale))
 							{
@@ -3808,12 +3756,10 @@ static void P_DoTeeter(player_t *player)
 
 			ceilingheight = sec->ceilingheight;
 			floorheight = sec->floorheight;
-#ifdef ESLOPE
 			if (sec->c_slope)
 				ceilingheight = P_GetZAt(sec->c_slope, checkx, checky);
 			if (sec->f_slope)
 				floorheight = P_GetZAt(sec->f_slope, checkx, checky);
-#endif
 			highestceilingheight = (ceilingheight > highestceilingheight) ? ceilingheight : highestceilingheight;
 			lowestfloorheight = (floorheight < lowestfloorheight) ? floorheight : lowestfloorheight;
 
@@ -3824,13 +3770,8 @@ static void P_DoTeeter(player_t *player)
 			{
 				if (!(rover->flags & FF_EXISTS)) continue;
 
-#ifdef ESLOPE
 				topheight = *rover->t_slope ? P_GetZAt(*rover->t_slope, player->mo->x, player->mo->y) : *rover->topheight;
 				bottomheight = *rover->b_slope ? P_GetZAt(*rover->b_slope, player->mo->x, player->mo->y) : *rover->bottomheight;
-#else
-				topheight = *rover->topheight;
-				bottomheight = *rover->bottomheight;
-#endif
 
 				if (P_CheckSolidLava(rover))
 					;
@@ -4633,17 +4574,13 @@ static void P_DoSpinAbility(player_t *player, ticcmd_t *cmd)
 		&& (player->pflags & PF_JUMPSTASIS || player->mo->state-states != S_PLAY_GLIDE_LANDING))
 		return;
 
-#ifdef HAVE_BLUA
 	if (cmd->buttons & BT_USE)
 	{
 		if (LUAh_SpinSpecial(player))
 			return;
 	}
-#endif
 
-#ifdef ESLOPE
 	canstand = (!player->mo->standingslope || (player->mo->standingslope->flags & SL_NOPHYSICS) || abs(player->mo->standingslope->zdelta) < FRACUNIT/2);
-#endif
 
 	///////////////////////////////
 	// ability-specific behavior //
@@ -5125,11 +5062,7 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd)
 					}
 				}
 			}
-			if (cmd->buttons & BT_USE // Spin button effects
-	#ifdef HAVE_BLUA
-			&& !LUAh_ShieldSpecial(player)
-	#endif
-				)
+			if (cmd->buttons & BT_USE && !LUAh_ShieldSpecial(player)) // Spin button effects
 			{
 				// Force stop
 				if ((player->powers[pw_shield] & ~(SH_FORCEHP|SH_STACK)) == SH_FORCE)
@@ -5207,51 +5140,48 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd)
 				// and you don't have a shield, do it!
 				P_DoSuperTransformation(player, false);
 			}
-			else
-#ifdef HAVE_BLUA
-			if (!LUAh_JumpSpinSpecial(player))
-#endif
-			switch (player->charability)
-			{
-				case CA_THOK:
-					if (player->powers[pw_super]) // Super Sonic float
-					{
-						if ((player->speed > 5*player->mo->scale) // FixedMul(5<<FRACBITS, player->mo->scale), but scale is FRACUNIT-based
-						&& (P_MobjFlip(player->mo)*player->mo->momz <= 0))
+			else if (!LUAh_JumpSpinSpecial(player))
+				switch (player->charability)
+				{
+					case CA_THOK:
+						if (player->powers[pw_super]) // Super Sonic float
 						{
-							if (player->panim != PA_RUN && player->panim != PA_WALK)
+							if ((player->speed > 5*player->mo->scale) // FixedMul(5<<FRACBITS, player->mo->scale), but scale is FRACUNIT-based
+							&& (P_MobjFlip(player->mo)*player->mo->momz <= 0))
 							{
-								if (player->speed >= FixedMul(player->runspeed, player->mo->scale))
-									P_SetPlayerMobjState(player->mo, S_PLAY_FLOAT_RUN);
-								else
-									P_SetPlayerMobjState(player->mo, S_PLAY_FLOAT);
-							}
+								if (player->panim != PA_RUN && player->panim != PA_WALK)
+								{
+									if (player->speed >= FixedMul(player->runspeed, player->mo->scale))
+										P_SetPlayerMobjState(player->mo, S_PLAY_FLOAT_RUN);
+									else
+										P_SetPlayerMobjState(player->mo, S_PLAY_FLOAT);
+								}
 
-							player->mo->momz = 0;
-							player->pflags &= ~(PF_STARTJUMP|PF_SPINNING);
+								player->mo->momz = 0;
+								player->pflags &= ~(PF_STARTJUMP|PF_SPINNING);
+							}
 						}
-					}
-					break;
-				case CA_TELEKINESIS:
-					if (!(player->pflags & (PF_THOKKED|PF_USEDOWN)) || (player->charflags & SF_MULTIABILITY))
-					{
-						P_Telekinesis(player,
-							-FixedMul(player->actionspd, player->mo->scale), // -ve thrust (pulling towards player)
-							FixedMul(384*FRACUNIT, player->mo->scale));
-					}
-					break;
-				case CA_TWINSPIN:
-					if ((player->charability2 == CA2_MELEE) && (!(player->pflags & (PF_THOKKED|PF_USEDOWN)) || player->charflags & SF_MULTIABILITY))
-					{
-						player->pflags |= PF_THOKKED;
-						S_StartSound(player->mo, sfx_s3k42);
-						player->mo->frame = 0;
-						P_SetPlayerMobjState(player->mo, S_PLAY_TWINSPIN);
-					}
-					break;
-				default:
-					break;
-			}
+						break;
+					case CA_TELEKINESIS:
+						if (!(player->pflags & (PF_THOKKED|PF_USEDOWN)) || (player->charflags & SF_MULTIABILITY))
+						{
+							P_Telekinesis(player,
+								-FixedMul(player->actionspd, player->mo->scale), // -ve thrust (pulling towards player)
+								FixedMul(384*FRACUNIT, player->mo->scale));
+						}
+						break;
+					case CA_TWINSPIN:
+						if ((player->charability2 == CA2_MELEE) && (!(player->pflags & (PF_THOKKED|PF_USEDOWN)) || player->charflags & SF_MULTIABILITY))
+						{
+							player->pflags |= PF_THOKKED;
+							S_StartSound(player->mo, sfx_s3k42);
+							player->mo->frame = 0;
+							P_SetPlayerMobjState(player->mo, S_PLAY_TWINSPIN);
+						}
+						break;
+					default:
+						break;
+				}
 		}
 	}
 
@@ -5287,16 +5217,13 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd)
 
 	if (cmd->buttons & BT_JUMP && !player->exiting && !P_PlayerInPain(player))
 	{
-#ifdef HAVE_BLUA
 		if (LUAh_JumpSpecial(player))
 			;
-		else
-#endif
-		if (player->pflags & PF_JUMPDOWN) // all situations below this require jump button not to be pressed already
+		// all situations below this require jump button not to be pressed already
+		else if (player->pflags & PF_JUMPDOWN)
 			;
-		else
 		// Jump S3&K style while in quicksand.
-		if (P_InQuicksand(player->mo))
+		else if (P_InQuicksand(player->mo))
 		{
 			P_DoJump(player, true);
 			player->secondjump = 0;
@@ -5308,9 +5235,8 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd)
 			P_SetTarget(&player->mo->tracer, NULL);
 			player->powers[pw_flashing] = TICRATE/4;
 		}
-		else
 		// can't jump while in air, can't jump while jumping
-		if (onground || player->climbing || player->powers[pw_carry])
+		else if (onground || player->climbing || player->powers[pw_carry])
 		{
 			P_DoJump(player, true);
 			player->secondjump = 0;
@@ -5326,9 +5252,7 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd)
 		}*/
 		else if (player->pflags & PF_JUMPED)
 		{
-#ifdef HAVE_BLUA
 			if (!LUAh_AbilitySpecial(player))
-#endif
 			switch (player->charability)
 			{
 				case CA_THOK:
@@ -5523,30 +5447,28 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd)
 		}
 		else if (player->pflags & PF_THOKKED)
 		{
-#ifdef HAVE_BLUA
 			if (!LUAh_AbilitySpecial(player))
-#endif
-			switch (player->charability)
-			{
-				case CA_FLY:
-				case CA_SWIM: // Swim
-					if (player->charability == CA_SWIM && !(player->mo->eflags & MFE_UNDERWATER))
-						; // Can't do anything if you're a fish out of water!
-					else if (player->powers[pw_tailsfly]) // If currently flying, give an ascend boost.
-					{
-						player->fly1 = 20;
+				switch (player->charability)
+				{
+					case CA_FLY:
+					case CA_SWIM: // Swim
+						if (player->charability == CA_SWIM && !(player->mo->eflags & MFE_UNDERWATER))
+							; // Can't do anything if you're a fish out of water!
+						else if (player->powers[pw_tailsfly]) // If currently flying, give an ascend boost.
+						{
+							player->fly1 = 20;
 
-						if (player->charability == CA_SWIM)
-							player->fly1 /= 2;
+							if (player->charability == CA_SWIM)
+								player->fly1 /= 2;
 
-						// Slow down!
-						if (player->speed > FixedMul(8*FRACUNIT, player->mo->scale) && player->speed > FixedMul(player->normalspeed>>1, player->mo->scale))
-							P_Thrust(player->mo, R_PointToAngle2(0,0,player->mo->momx,player->mo->momy), FixedMul(-4*FRACUNIT, player->mo->scale));
-					}
-					break;
-				default:
-					break;
-			}
+							// Slow down!
+							if (player->speed > FixedMul(8*FRACUNIT, player->mo->scale) && player->speed > FixedMul(player->normalspeed>>1, player->mo->scale))
+								P_Thrust(player->mo, R_PointToAngle2(0,0,player->mo->momx,player->mo->momy), FixedMul(-4*FRACUNIT, player->mo->scale));
+						}
+						break;
+					default:
+						break;
+				}
 		}
 		else if ((player->powers[pw_shield] & SH_NOSTACK) == SH_WHIRLWIND && !player->powers[pw_super])
 			P_DoJumpShield(player);
@@ -5921,12 +5843,10 @@ static void P_3dMovement(player_t *player)
 	controlstyle_e controlstyle;
 	boolean spin = ((onground = P_IsObjectOnGround(player->mo)) && (player->pflags & (PF_SPINNING|PF_THOKKED)) == PF_SPINNING && (player->rmomx || player->rmomy) && !(player->pflags & PF_STARTDASH));
 	fixed_t oldMagnitude, newMagnitude;
-#ifdef ESLOPE
 	vector3_t totalthrust;
 
 	totalthrust.x = totalthrust.y = 0; // I forget if this is needed
 	totalthrust.z = FRACUNIT*P_MobjFlip(player->mo)/3; // A bit of extra push-back on slopes
-#endif // ESLOPE
 
 	// Get the old momentum; this will be needed at the end of the function! -SH
 	oldMagnitude = R_PointToDist2(player->mo->momx - player->cmomx, player->mo->momy - player->cmomy, 0, 0);
@@ -6127,12 +6047,8 @@ static void P_3dMovement(player_t *player)
 
 		movepushforward = FixedMul(movepushforward, player->mo->scale);
 
-#ifdef ESLOPE
 		totalthrust.x += P_ReturnThrustX(player->mo, movepushangle, movepushforward);
 		totalthrust.y += P_ReturnThrustY(player->mo, movepushangle, movepushforward);
-#else
-		P_Thrust(player->mo, movepushangle, movepushforward);
-#endif
 	}
 	// Sideways movement
 	if (player->climbing)
@@ -6175,12 +6091,8 @@ static void P_3dMovement(player_t *player)
 
 			movepushforward = FixedMul(movepushforward, player->mo->scale);
 
-#ifdef ESLOPE
 			totalthrust.x += P_ReturnThrustX(player->mo, controldirection, movepushforward);
 			totalthrust.y += P_ReturnThrustY(player->mo, controldirection, movepushforward);
-#else
-			P_Thrust(player->mo, controldirection, movepushforward);
-#endif
 		}
 	}
 	else if (cmd->sidemove && !(player->pflags & PF_GLIDING) && !player->exiting && !P_PlayerInPain(player))
@@ -6209,15 +6121,10 @@ static void P_3dMovement(player_t *player)
 		// Finally move the player now that their speed/direction has been decided.
 		movepushside = FixedMul(movepushside, player->mo->scale);
 
-#ifdef ESLOPE
 		totalthrust.x += P_ReturnThrustX(player->mo, movepushsideangle, movepushside);
 		totalthrust.y += P_ReturnThrustY(player->mo, movepushsideangle, movepushside);
-#else
-		P_Thrust(player->mo, movepushsideangle, movepushside);
-#endif
 	}
 
-#ifdef ESLOPE
 	if ((totalthrust.x || totalthrust.y)
 		&& player->mo->standingslope && (!(player->mo->standingslope->flags & SL_NOPHYSICS)) && abs(player->mo->standingslope->zdelta) > FRACUNIT/2) {
 		// Factor thrust to slope, but only for the part pushing up it!
@@ -6237,7 +6144,6 @@ static void P_3dMovement(player_t *player)
 
 	player->mo->momx += totalthrust.x;
 	player->mo->momy += totalthrust.y;
-#endif
 
 	// Time to ask three questions:
 	// 1) Are we over topspeed?
@@ -7850,14 +7756,13 @@ void P_ElementalFire(player_t *player, boolean cropcircle)
 			newx = player->mo->x + P_ReturnThrustX(player->mo, (travelangle + ((i&1) ? -1 : 1)*ANGLE_135), FixedMul(24*FRACUNIT, player->mo->scale));
 			newy = player->mo->y + P_ReturnThrustY(player->mo, (travelangle + ((i&1) ? -1 : 1)*ANGLE_135), FixedMul(24*FRACUNIT, player->mo->scale));
 
-#ifdef ESLOPE
 			if (player->mo->standingslope)
 			{
 				ground = P_GetZAt(player->mo->standingslope, newx, newy);
 				if (player->mo->eflags & MFE_VERTICALFLIP)
 					ground -= FixedMul(mobjinfo[MT_SPINFIRE].height, player->mo->scale);
 			}
-#endif
+
 			flame = P_SpawnMobj(newx, newy, ground, MT_SPINFIRE);
 			P_SetTarget(&flame->target, player->mo);
 			flame->angle = travelangle;
@@ -10633,10 +10538,8 @@ boolean P_SpectatorJoinGame(player_t *player)
 		else
 			changeto = (P_RandomFixed() & 1) + 1;
 
-#ifdef HAVE_BLUA
 		if (!LUAh_TeamSwitch(player, changeto, true, false, false))
 			return false;
-#endif
 
 		if (player->mo)
 		{
@@ -10650,11 +10553,9 @@ boolean P_SpectatorJoinGame(player_t *player)
 		//Reset away view
 		if (P_IsLocalPlayer(player) && displayplayer != consoleplayer)
 		{
-#ifdef HAVE_BLUA
 			// Call ViewpointSwitch hooks here.
 			// The viewpoint was forcibly changed.
-			LUAh_ViewpointSwitch(player, &players[displayplayer], true);
-#endif
+			LUAh_ViewpointSwitch(player, &players[consoleplayer], true);
 			displayplayer = consoleplayer;
 		}
 
@@ -10672,10 +10573,8 @@ boolean P_SpectatorJoinGame(player_t *player)
 		// respawn in place and sit there for the rest of the round.
 		if (!((gametyperules & GTR_HIDEFROZEN) && leveltime > (hidetime * TICRATE)))
 		{
-#ifdef HAVE_BLUA
 			if (!LUAh_TeamSwitch(player, 3, true, false, false))
 				return false;
-#endif
 			if (player->mo)
 			{
 				P_RemoveMobj(player->mo);
@@ -10699,11 +10598,9 @@ boolean P_SpectatorJoinGame(player_t *player)
 			//Reset away view
 			if (P_IsLocalPlayer(player) && displayplayer != consoleplayer)
 			{
-#ifdef HAVE_BLUA
 				// Call ViewpointSwitch hooks here.
 				// The viewpoint was forcibly changed.
-				LUAh_ViewpointSwitch(player, &players[displayplayer], true);
-#endif
+				LUAh_ViewpointSwitch(player, &players[consoleplayer], true);
 				displayplayer = consoleplayer;
 			}
 
@@ -10766,13 +10663,8 @@ static void P_CalcPostImg(player_t *player)
 			if (!(rover->flags & FF_EXISTS))
 				continue;
 
-#ifdef ESLOPE
 			topheight = *rover->t_slope ? P_GetZAt(*rover->t_slope, player->mo->x, player->mo->y) : *rover->topheight;
 			bottomheight = *rover->b_slope ? P_GetZAt(*rover->b_slope, player->mo->x, player->mo->y) : *rover->bottomheight;
-#else
-			topheight = *rover->topheight;
-			bottomheight = *rover->bottomheight;
-#endif
 
 			if (pviewheight >= topheight || pviewheight <= bottomheight)
 				continue;
@@ -10794,13 +10686,8 @@ static void P_CalcPostImg(player_t *player)
 			if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_SWIMMABLE) || rover->flags & FF_BLOCKPLAYER)
 				continue;
 
-#ifdef ESLOPE
 			topheight = *rover->t_slope ? P_GetZAt(*rover->t_slope, player->mo->x, player->mo->y) : *rover->topheight;
 			bottomheight = *rover->b_slope ? P_GetZAt(*rover->b_slope, player->mo->x, player->mo->y) : *rover->bottomheight;
-#else
-			topheight = *rover->topheight;
-			bottomheight = *rover->bottomheight;
-#endif
 
 			if (pviewheight >= topheight || pviewheight <= bottomheight)
 				continue;
@@ -11626,9 +11513,7 @@ void P_PlayerThink(player_t *player)
 		}
 		if (player->playerstate == PST_REBORN)
 		{
-#ifdef HAVE_BLUA
 			LUAh_PlayerThink(player);
-#endif
 			return;
 		}
 	}
@@ -11732,9 +11617,7 @@ void P_PlayerThink(player_t *player)
 
 			if (player->playerstate == PST_DEAD)
 			{
-#ifdef HAVE_BLUA
 				LUAh_PlayerThink(player);
-#endif
 				return;
 			}
 		}
@@ -11857,9 +11740,7 @@ void P_PlayerThink(player_t *player)
 	{
 		player->mo->flags2 &= ~MF2_SHADOW;
 		P_DeathThink(player);
-#ifdef HAVE_BLUA
 		LUAh_PlayerThink(player);
-#endif
 		return;
 	}
 
@@ -11901,9 +11782,7 @@ void P_PlayerThink(player_t *player)
 	{
 		if (P_SpectatorJoinGame(player))
 		{
-#ifdef HAVE_BLUA
 			LUAh_PlayerThink(player);
-#endif
 			return; // player->mo was removed.
 		}
 	}
@@ -12008,9 +11887,7 @@ void P_PlayerThink(player_t *player)
 
 	if (!player->mo)
 	{
-#ifdef HAVE_BLUA
 		LUAh_PlayerThink(player);
-#endif
 		return; // P_MovePlayer removed player->mo.
 	}
 
@@ -12452,9 +12329,7 @@ void P_PlayerThink(player_t *player)
 	}
 #undef dashmode
 
-#ifdef HAVE_BLUA
 	LUAh_PlayerThink(player);
-#endif
 
 /*
 //	Colormap verification
@@ -13004,11 +12879,9 @@ void P_PlayerAfterThink(player_t *player)
 
 		if (player->followmobj)
 		{
-#ifdef HAVE_BLUA
 			if (LUAh_FollowMobj(player, player->followmobj) || P_MobjWasRemoved(player->followmobj))
 				{;}
 			else
-#endif
 			{
 				switch (player->followmobj->type)
 				{
diff --git a/src/r_bsp.c b/src/r_bsp.c
index c0011f4b9608ced5025bd4ceee912add40114301..85113be43d1fa150ac665e3f0c29c05e28e244fe 100644
--- a/src/r_bsp.c
+++ b/src/r_bsp.c
@@ -359,10 +359,8 @@ boolean R_IsEmptyLine(seg_t *line, sector_t *front, sector_t *back)
 #endif
 		back->ceilingpic == front->ceilingpic
 		&& back->floorpic == front->floorpic
-#ifdef ESLOPE
 		&& back->f_slope == front->f_slope
 		&& back->c_slope == front->c_slope
-#endif
 		&& back->lightlevel == front->lightlevel
 		&& !line->sidedef->midtexture
 		// Check offsets too!
@@ -497,7 +495,6 @@ static void R_AddLine(seg_t *line)
 	}
 
 	// Closed door.
-#ifdef ESLOPE
 	if (frontsector->f_slope || frontsector->c_slope || backsector->f_slope || backsector->c_slope)
 	{
 		fixed_t frontf1,frontf2, frontc1, frontc2; // front floor/ceiling ends
@@ -542,7 +539,6 @@ static void R_AddLine(seg_t *line)
 				goto clippass;
 	}
 	else
-#endif
 	{
 		// if both ceilings are skies, consider it always "open"
 		// same for floors
@@ -863,16 +859,12 @@ static void R_Subsector(size_t num)
 
 	floorcolormap = ceilingcolormap = frontsector->extra_colormap;
 
-	floorcenterz =
-#ifdef ESLOPE
-		frontsector->f_slope ? P_GetZAt(frontsector->f_slope, frontsector->soundorg.x, frontsector->soundorg.y) :
-#endif
+	floorcenterz = frontsector->f_slope ?
+		P_GetZAt(frontsector->f_slope, frontsector->soundorg.x, frontsector->soundorg.y) :
 		frontsector->floorheight;
 
-	ceilingcenterz =
-#ifdef ESLOPE
-		frontsector->c_slope ? P_GetZAt(frontsector->c_slope, frontsector->soundorg.x, frontsector->soundorg.y) :
-#endif
+	ceilingcenterz = frontsector->c_slope ?
+		P_GetZAt(frontsector->c_slope, frontsector->soundorg.x, frontsector->soundorg.y) :
 		frontsector->ceilingheight;
 
 	// Check and prep all 3D floors. Set the sector floor/ceiling light levels and colormaps.
@@ -899,34 +891,23 @@ static void R_Subsector(size_t num)
 
 	sub->sector->extra_colormap = frontsector->extra_colormap;
 
-	if (((
-#ifdef ESLOPE
-			frontsector->f_slope ? P_GetZAt(frontsector->f_slope, viewx, viewy) :
-#endif
-		frontsector->floorheight) < viewz || frontsector->floorpic == skyflatnum
-		|| (frontsector->heightsec != -1
-		&& sectors[frontsector->heightsec].ceilingpic == skyflatnum)))
+	if ((frontsector->f_slope ? P_GetZAt(frontsector->f_slope, viewx, viewy) : frontsector->floorheight) < viewz
+		|| frontsector->floorpic == skyflatnum
+		|| (frontsector->heightsec != -1 && sectors[frontsector->heightsec].ceilingpic == skyflatnum))
 	{
 		floorplane = R_FindPlane(frontsector->floorheight, frontsector->floorpic, floorlightlevel,
 			frontsector->floor_xoffs, frontsector->floor_yoffs, frontsector->floorpic_angle, floorcolormap, NULL
 #ifdef POLYOBJECTS_PLANES
 			, NULL
 #endif
-#ifdef ESLOPE
-			, frontsector->f_slope
-#endif
-			);
+			, frontsector->f_slope);
 	}
 	else
 		floorplane = NULL;
 
-	if (((
-#ifdef ESLOPE
-			frontsector->c_slope ? P_GetZAt(frontsector->c_slope, viewx, viewy) :
-#endif
-		frontsector->ceilingheight) > viewz || frontsector->ceilingpic == skyflatnum
-		|| (frontsector->heightsec != -1
-		&& sectors[frontsector->heightsec].floorpic == skyflatnum)))
+	if ((frontsector->c_slope ? P_GetZAt(frontsector->c_slope, viewx, viewy) : frontsector->ceilingheight) > viewz
+		|| frontsector->ceilingpic == skyflatnum
+		|| (frontsector->heightsec != -1 && sectors[frontsector->heightsec].floorpic == skyflatnum))
 	{
 		ceilingplane = R_FindPlane(frontsector->ceilingheight, frontsector->ceilingpic,
 			ceilinglightlevel, frontsector->ceiling_xoffs, frontsector->ceiling_yoffs, frontsector->ceilingpic_angle,
@@ -934,18 +915,13 @@ static void R_Subsector(size_t num)
 #ifdef POLYOBJECTS_PLANES
 			, NULL
 #endif
-#ifdef ESLOPE
-			, frontsector->c_slope
-#endif
-			);
+			, frontsector->c_slope);
 	}
 	else
 		ceilingplane = NULL;
 
 	numffloors = 0;
-#ifdef ESLOPE
 	ffloor[numffloors].slope = NULL;
-#endif
 	ffloor[numffloors].plane = NULL;
 	ffloor[numffloors].polyobj = NULL;
 	if (frontsector->ffloors)
@@ -970,16 +946,12 @@ static void R_Subsector(size_t num)
 			ffloor[numffloors].plane = NULL;
 			ffloor[numffloors].polyobj = NULL;
 
-			heightcheck =
-#ifdef ESLOPE
-				*rover->b_slope ? P_GetZAt(*rover->b_slope, viewx, viewy) :
-#endif
+			heightcheck = *rover->b_slope ?
+				P_GetZAt(*rover->b_slope, viewx, viewy) :
 				*rover->bottomheight;
 
-			planecenterz =
-#ifdef ESLOPE
-				*rover->b_slope ? P_GetZAt(*rover->b_slope, frontsector->soundorg.x, frontsector->soundorg.y) :
-#endif
+			planecenterz = *rover->b_slope ?
+				P_GetZAt(*rover->b_slope, frontsector->soundorg.x, frontsector->soundorg.y) :
 				*rover->bottomheight;
 			if (planecenterz <= ceilingcenterz
 				&& planecenterz >= floorcenterz
@@ -995,18 +967,13 @@ static void R_Subsector(size_t num)
 #ifdef POLYOBJECTS_PLANES
 					, NULL
 #endif
-#ifdef ESLOPE
-					, *rover->b_slope
-#endif
-					);
+					, *rover->b_slope);
 
-#ifdef ESLOPE
 				ffloor[numffloors].slope = *rover->b_slope;
 
 				// Tell the renderer this sector has slopes in it.
 				if (ffloor[numffloors].slope)
 					frontsector->hasslope = true;
-#endif
 
 				ffloor[numffloors].height = heightcheck;
 				ffloor[numffloors].ffloor = rover;
@@ -1017,16 +984,12 @@ static void R_Subsector(size_t num)
 			ffloor[numffloors].plane = NULL;
 			ffloor[numffloors].polyobj = NULL;
 
-			heightcheck =
-#ifdef ESLOPE
-				*rover->t_slope ? P_GetZAt(*rover->t_slope, viewx, viewy) :
-#endif
+			heightcheck = *rover->t_slope ?
+				P_GetZAt(*rover->t_slope, viewx, viewy) :
 				*rover->topheight;
 
-			planecenterz =
-#ifdef ESLOPE
-				*rover->t_slope ? P_GetZAt(*rover->t_slope, frontsector->soundorg.x, frontsector->soundorg.y) :
-#endif
+			planecenterz = *rover->t_slope ?
+				P_GetZAt(*rover->t_slope, frontsector->soundorg.x, frontsector->soundorg.y) :
 				*rover->topheight;
 			if (planecenterz >= floorcenterz
 				&& planecenterz <= ceilingcenterz
@@ -1041,18 +1004,13 @@ static void R_Subsector(size_t num)
 #ifdef POLYOBJECTS_PLANES
 					, NULL
 #endif
-#ifdef ESLOPE
-					, *rover->t_slope
-#endif
-					);
+					, *rover->t_slope);
 
-#ifdef ESLOPE
 				ffloor[numffloors].slope = *rover->t_slope;
 
 				// Tell the renderer this sector has slopes in it.
 				if (ffloor[numffloors].slope)
 					frontsector->hasslope = true;
-#endif
 
 				ffloor[numffloors].height = heightcheck;
 				ffloor[numffloors].ffloor = rover;
@@ -1090,18 +1048,13 @@ static void R_Subsector(size_t num)
 				ffloor[numffloors].plane = R_FindPlane(polysec->floorheight, polysec->floorpic,
 					(light == -1 ? frontsector->lightlevel : *frontsector->lightlist[light].lightlevel), polysec->floor_xoffs, polysec->floor_yoffs,
 					polysec->floorpic_angle-po->angle,
-					(light == -1 ? frontsector->extra_colormap : *frontsector->lightlist[light].extra_colormap), NULL, po
-#ifdef ESLOPE
-					, NULL // will ffloors be slopable eventually?
-#endif
-					);
+					(light == -1 ? frontsector->extra_colormap : *frontsector->lightlist[light].extra_colormap), NULL, po,
+					NULL); // will ffloors be slopable eventually?
 
 				ffloor[numffloors].height = polysec->floorheight;
 				ffloor[numffloors].polyobj = po;
-#ifdef ESLOPE
 				ffloor[numffloors].slope = NULL;
-#endif
-//				ffloor[numffloors].ffloor = rover;
+				//ffloor[numffloors].ffloor = rover;
 				po->visplane = ffloor[numffloors].plane;
 				numffloors++;
 			}
@@ -1118,18 +1071,13 @@ static void R_Subsector(size_t num)
 				light = R_GetPlaneLight(frontsector, polysec->floorheight, viewz < polysec->floorheight);
 				ffloor[numffloors].plane = R_FindPlane(polysec->ceilingheight, polysec->ceilingpic,
 					(light == -1 ? frontsector->lightlevel : *frontsector->lightlist[light].lightlevel), polysec->ceiling_xoffs, polysec->ceiling_yoffs, polysec->ceilingpic_angle-po->angle,
-					(light == -1 ? frontsector->extra_colormap : *frontsector->lightlist[light].extra_colormap), NULL, po
-#ifdef ESLOPE
-					, NULL // will ffloors be slopable eventually?
-#endif
-					);
+					(light == -1 ? frontsector->extra_colormap : *frontsector->lightlist[light].extra_colormap), NULL, po,
+					NULL); // will ffloors be slopable eventually?
 
 				ffloor[numffloors].polyobj = po;
 				ffloor[numffloors].height = polysec->ceilingheight;
-#ifdef ESLOPE
 				ffloor[numffloors].slope = NULL;
-#endif
-//				ffloor[numffloors].ffloor = rover;
+				//ffloor[numffloors].ffloor = rover;
 				po->visplane = ffloor[numffloors].plane;
 				numffloors++;
 			}
@@ -1192,11 +1140,9 @@ void R_Prep3DFloors(sector_t *sector)
 	fixed_t bestheight, maxheight;
 	INT32 count, i;
 	sector_t *sec;
-#ifdef ESLOPE
 	pslope_t *bestslope = NULL;
 	fixed_t heighttest; // I think it's better to check the Z height at the sector's center
 	                    // than assume unsloped heights are accurate indicators of order in sloped sectors. -Red
-#endif
 
 	count = 1;
 	for (rover = sector->ffloors; rover; rover = rover->next)
@@ -1219,14 +1165,10 @@ void R_Prep3DFloors(sector_t *sector)
 	else
 		memset(sector->lightlist, 0, sizeof (lightlist_t) * count);
 
-#ifdef ESLOPE
 	heighttest = sector->c_slope ? P_GetZAt(sector->c_slope, sector->soundorg.x, sector->soundorg.y) : sector->ceilingheight;
 
 	sector->lightlist[0].height = heighttest + 1;
 	sector->lightlist[0].slope = sector->c_slope;
-#else
-	sector->lightlist[0].height = sector->ceilingheight + 1;
-#endif
 	sector->lightlist[0].lightlevel = &sector->lightlevel;
 	sector->lightlist[0].caster = NULL;
 	sector->lightlist[0].extra_colormap = &sector->extra_colormap;
@@ -1244,7 +1186,6 @@ void R_Prep3DFloors(sector_t *sector)
 				&& !(rover->flags & FF_CUTLEVEL) && !(rover->flags & FF_CUTSPRITES)))
 			continue;
 
-#ifdef ESLOPE
 			heighttest = *rover->t_slope ? P_GetZAt(*rover->t_slope, sector->soundorg.x, sector->soundorg.y) : *rover->topheight;
 
 			if (heighttest > bestheight && heighttest < maxheight)
@@ -1266,21 +1207,6 @@ void R_Prep3DFloors(sector_t *sector)
 					continue;
 				}
 			}
-#else
-			if (*rover->topheight > bestheight && *rover->topheight < maxheight)
-			{
-				best = rover;
-				bestheight = *rover->topheight;
-				continue;
-			}
-			if (rover->flags & FF_DOUBLESHADOW && *rover->bottomheight > bestheight
-				&& *rover->bottomheight < maxheight)
-			{
-				best = rover;
-				bestheight = *rover->bottomheight;
-				continue;
-			}
-#endif
 		}
 		if (!best)
 		{
@@ -1291,9 +1217,7 @@ void R_Prep3DFloors(sector_t *sector)
 		sector->lightlist[i].height = maxheight = bestheight;
 		sector->lightlist[i].caster = best;
 		sector->lightlist[i].flags = best->flags;
-#ifdef ESLOPE
 		sector->lightlist[i].slope = bestslope;
-#endif
 		sec = &sectors[best->secnum];
 
 		if (best->flags & FF_NOSHADE)
@@ -1314,12 +1238,8 @@ void R_Prep3DFloors(sector_t *sector)
 
 		if (best->flags & FF_DOUBLESHADOW)
 		{
-#ifdef ESLOPE
 			heighttest = *best->b_slope ? P_GetZAt(*best->b_slope, sector->soundorg.x, sector->soundorg.y) : *best->bottomheight;
 			if (bestheight == heighttest) ///TODO: do this in a more efficient way -Red
-#else
-			if (bestheight == *best->bottomheight)
-#endif
 			{
 				sector->lightlist[i].lightlevel = sector->lightlist[best->lastlight].lightlevel;
 				sector->lightlist[i].extra_colormap =
diff --git a/src/r_defs.h b/src/r_defs.h
index 0f85c9a57fcf0748d80b6f9941c0cfca910d5e82..4e2231d728f8f81835e4ce3b2077625629fb785d 100644
--- a/src/r_defs.h
+++ b/src/r_defs.h
@@ -171,11 +171,9 @@ typedef struct ffloor_s
 	fixed_t *bottomyoffs;
 	angle_t *bottomangle;
 
-#ifdef ESLOPE
 	// Pointers to pointers. Yup.
 	struct pslope_s **t_slope;
 	struct pslope_s **b_slope;
-#endif
 
 	size_t secnum;
 	ffloortype_e flags;
@@ -208,9 +206,7 @@ typedef struct lightlist_s
 	extracolormap_t **extra_colormap; // pointer-to-a-pointer, so we can react to colormap changes
 	INT32 flags;
 	ffloor_t *caster;
-#ifdef ESLOPE
 	struct pslope_s *slope; // FF_DOUBLESHADOW makes me have to store this pointer here. Bluh bluh.
-#endif
 } lightlist_t;
 
 
@@ -244,7 +240,6 @@ typedef struct linechain_s
 
 
 // Slopes
-#ifdef ESLOPE
 typedef enum {
 	SL_NOPHYSICS = 1, /// This plane will have no physics applied besides the positioning.
 	SL_DYNAMIC = 1<<1, /// This plane slope will be assigned a thinker to make it dynamic.
@@ -268,7 +263,6 @@ typedef struct pslope_s
 
 	UINT8 flags; // Slope options
 } pslope_t;
-#endif
 
 typedef enum
 {
@@ -380,12 +374,10 @@ typedef struct sector_s
 	precipmobj_t *preciplist;
 	struct mprecipsecnode_s *touching_preciplist;
 
-#ifdef ESLOPE
 	// Eternity engine slope
 	pslope_t *f_slope; // floor slope
 	pslope_t *c_slope; // ceiling slope
 	boolean hasslope; // The sector, or one of its visible FOFs, contains a slope
-#endif
 
 	// for fade thinker
 	INT16 spawn_lightlevel;
@@ -675,11 +667,9 @@ typedef struct drawseg_s
 
 	UINT8 portalpass; // if > 0 and <= portalrender, do not affect sprite clipping
 
-#ifdef ESLOPE
 	fixed_t maskedtextureheight[MAXVIDWIDTH]; // For handling sloped midtextures
 
 	vertex_t leftpos, rightpos; // Used for rendering FOF walls with slopes
-#endif
 } drawseg_t;
 
 typedef enum
diff --git a/src/r_draw.c b/src/r_draw.c
index f46f4fb134b75e5f79905f7bba152d5c65299e7b..b983db0aadd44c56c1df4c89b3732f5be0c229c5 100644
--- a/src/r_draw.c
+++ b/src/r_draw.c
@@ -105,12 +105,10 @@ boolean ds_powersoftwo;
 UINT8 *ds_source; // start of a 64*64 tile image
 UINT8 *ds_transmap; // one of the translucency tables
 
-#ifdef ESLOPE
 pslope_t *ds_slope; // Current slope being used
 floatv3_t ds_su[MAXVIDHEIGHT], ds_sv[MAXVIDHEIGHT], ds_sz[MAXVIDHEIGHT]; // Vectors for... stuff?
 floatv3_t *ds_sup, *ds_svp, *ds_szp;
 float focallengthf, zeroheight;
-#endif
 
 /**	\brief Variable flat sizes
 */
diff --git a/src/r_draw.h b/src/r_draw.h
index 870d294c35eafb8468a13155c383853020a754bd..4d94f861b3f747f6e033b876112962916288fb78 100644
--- a/src/r_draw.h
+++ b/src/r_draw.h
@@ -62,7 +62,6 @@ extern boolean ds_powersoftwo;
 extern UINT8 *ds_source;
 extern UINT8 *ds_transmap;
 
-#ifdef ESLOPE
 typedef struct {
 	float x, y, z;
 } floatv3_t;
@@ -71,7 +70,6 @@ extern pslope_t *ds_slope; // Current slope being used
 extern floatv3_t ds_su[MAXVIDHEIGHT], ds_sv[MAXVIDHEIGHT], ds_sz[MAXVIDHEIGHT]; // Vectors for... stuff?
 extern floatv3_t *ds_sup, *ds_svp, *ds_szp;
 extern float focallengthf, zeroheight;
-#endif
 
 // Variable flat sizes
 extern UINT32 nflatxshift;
@@ -152,7 +150,6 @@ void R_DrawSpan_8(void);
 void R_DrawSplat_8(void);
 void R_DrawTranslucentSpan_8(void);
 void R_DrawTranslucentSplat_8(void);
-#ifdef ESLOPE
 void R_DrawTiltedSpan_8(void);
 void R_DrawTiltedTranslucentSpan_8(void);
 #ifndef NOWATER
@@ -161,7 +158,6 @@ void R_DrawTiltedTranslucentWaterSpan_8(void);
 void R_DrawTiltedSplat_8(void);
 void R_CalcTiltedLighting(fixed_t start, fixed_t end);
 extern INT32 tiltlighting[MAXVIDWIDTH];
-#endif
 #ifndef NOWATER
 void R_DrawTranslucentWaterSpan_8(void);
 extern INT32 ds_bgofs;
@@ -174,14 +170,12 @@ void R_DrawSpan_NPO2_8(void);
 void R_DrawTranslucentSpan_NPO2_8(void);
 void R_DrawSplat_NPO2_8(void);
 void R_DrawTranslucentSplat_NPO2_8(void);
-#ifdef ESLOPE
 void R_DrawTiltedSpan_NPO2_8(void);
 void R_DrawTiltedTranslucentSpan_NPO2_8(void);
 #ifndef NOWATER
 void R_DrawTiltedTranslucentWaterSpan_NPO2_8(void);
 #endif
 void R_DrawTiltedSplat_NPO2_8(void);
-#endif
 #ifndef NOWATER
 void R_DrawTranslucentWaterSpan_NPO2_8(void);
 #endif
diff --git a/src/r_draw8.c b/src/r_draw8.c
index fe0a23770e4fcabcd5fc32c529ebd10e7b617903..940ea724b31ef2411514799d4a9f7df7e284c907 100644
--- a/src/r_draw8.c
+++ b/src/r_draw8.c
@@ -620,7 +620,6 @@ void R_DrawSpan_8 (void)
 	}
 }
 
-#ifdef ESLOPE
 // R_CalcTiltedLighting
 // Exactly what it says on the tin. I wish I wasn't too lazy to explain things properly.
 INT32 tiltlighting[MAXVIDWIDTH];
@@ -1199,7 +1198,6 @@ void R_DrawTiltedSplat_8(void)
 	}
 #endif
 }
-#endif // ESLOPE
 
 /**	\brief The R_DrawSplat_8 function
 	Just like R_DrawSpan_8, but skips transparent pixels.
diff --git a/src/r_draw8_npo2.c b/src/r_draw8_npo2.c
index b91f492f2417535d84516b81cd1354f1c8268d1e..02015569455e94df9e4ec9a8c8be835cbd0da856 100644
--- a/src/r_draw8_npo2.c
+++ b/src/r_draw8_npo2.c
@@ -61,8 +61,6 @@ void R_DrawSpan_NPO2_8 (void)
 	}
 }
 
-#ifdef ESLOPE
-
 #define PLANELIGHTFLOAT (BASEVIDWIDTH * BASEVIDWIDTH / vid.width / (zeroheight - FIXED_TO_FLOAT(viewz)) / 21.0f * FIXED_TO_FLOAT(fovtan))
 
 /**	\brief The R_DrawTiltedSpan_NPO2_8 function
@@ -661,7 +659,6 @@ void R_DrawTiltedSplat_NPO2_8(void)
 	}
 #endif
 }
-#endif // ESLOPE
 
 /**	\brief The R_DrawSplat_NPO2_8 function
 	Just like R_DrawSpan_NPO2_8, but skips transparent pixels.
@@ -846,7 +843,6 @@ void R_DrawTranslucentWaterSpan_NPO2_8(void)
 	}
 }
 
-#ifdef ESLOPE
 /**	\brief The R_DrawTiltedTranslucentWaterSpan_NPO2_8 function
 	Like DrawTiltedTranslucentSpan_NPO2, but for water
 */
@@ -1043,5 +1039,4 @@ void R_DrawTiltedTranslucentWaterSpan_NPO2_8(void)
 	}
 #endif
 }
-#endif // ESLOPE
 #endif // NOWATER
diff --git a/src/r_main.c b/src/r_main.c
index 409a82f2827353e157a36f1193df072428eac702..9a3d98870fe1d206400fed4e4d0240deea52b682 100644
--- a/src/r_main.c
+++ b/src/r_main.c
@@ -459,9 +459,7 @@ static void R_InitTextureMapping(void)
 	focallength = FixedDiv(projection,
 		FINETANGENT(FINEANGLES/4+FIELDOFVIEW/2));
 
-#ifdef ESLOPE
 	focallengthf = FIXED_TO_FLOAT(focallength);
-#endif
 
 	for (i = 0; i < FINEANGLES/2; i++)
 	{
diff --git a/src/r_plane.c b/src/r_plane.c
index e1e45517a66d4a530a6477d4970e58d18d6bc292..ca5aa758e6d49d371b0e1b818574696b3f7e8b18 100644
--- a/src/r_plane.c
+++ b/src/r_plane.c
@@ -202,7 +202,6 @@ void R_MapPlane(INT32 y, INT32 x1, INT32 x2)
 		// Needed for ds_bgofs
 		R_PlaneRipple(currentplane, y, planeheight);
 
-#ifdef ESLOPE
 		if (currentplane->slope)
 		{
 			ds_sup = &ds_su[y];
@@ -210,7 +209,6 @@ void R_MapPlane(INT32 y, INT32 x1, INT32 x2)
 			ds_szp = &ds_sz[y];
 		}
 		else
-#endif
 		{
 			ds_xfrac += ripple_xfrac;
 			ds_yfrac += ripple_yfrac;
@@ -227,12 +225,10 @@ void R_MapPlane(INT32 y, INT32 x1, INT32 x2)
 	if (pindex >= MAXLIGHTZ)
 		pindex = MAXLIGHTZ - 1;
 
-#ifdef ESLOPE
 	if (currentplane->slope)
 		ds_colormap = colormaps;
 	else
-#endif
-	ds_colormap = planezlight[pindex];
+		ds_colormap = planezlight[pindex];
 
 	if (currentplane->extra_colormap)
 		ds_colormap = currentplane->extra_colormap->colormap + (ds_colormap - colormaps);
@@ -345,17 +341,12 @@ visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel,
 #ifdef POLYOBJECTS_PLANES
 			, polyobj_t *polyobj
 #endif
-#ifdef ESLOPE
-			, pslope_t *slope
-#endif
-			)
+			, pslope_t *slope)
 {
 	visplane_t *check;
 	unsigned hash;
 
-#ifdef ESLOPE
-	if (slope); else // Don't mess with this right now if a slope is involved
-#endif
+	if (!slope) // Don't mess with this right now if a slope is involved
 	{
 		xoff += viewx;
 		yoff -= viewy;
@@ -413,10 +404,7 @@ visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel,
 			&& check->viewx == viewx && check->viewy == viewy && check->viewz == viewz
 			&& check->viewangle == viewangle
 			&& check->plangle == plangle
-#ifdef ESLOPE
-			&& check->slope == slope
-#endif
-			)
+			&& check->slope == slope)
 		{
 			return check;
 		}
@@ -441,9 +429,7 @@ visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel,
 #ifdef POLYOBJECTS_PLANES
 	check->polyobj = polyobj;
 #endif
-#ifdef ESLOPE
 	check->slope = slope;
-#endif
 
 	memset(check->top, 0xff, sizeof (check->top));
 	memset(check->bottom, 0x00, sizeof (check->bottom));
@@ -513,9 +499,7 @@ visplane_t *R_CheckPlane(visplane_t *pl, INT32 start, INT32 stop)
 #ifdef POLYOBJECTS_PLANES
 		new_pl->polyobj = pl->polyobj;
 #endif
-#ifdef ESLOPE
 		new_pl->slope = pl->slope;
-#endif
 		pl = new_pl;
 		pl->minx = start;
 		pl->maxx = stop;
@@ -860,7 +844,6 @@ static UINT8 *R_GetTextureFlat(levelflat_t *levelflat, boolean leveltexture, boo
 	return flat;
 }
 
-#ifdef ESLOPE
 static void R_SlopeVectors(visplane_t *pl, INT32 i, float fudge)
 {
 	// Potentially override other stuff for now cus we're mean. :< But draw a slope plane!
@@ -951,7 +934,6 @@ d.z = (v1.x * v2.y) - (v1.y * v2.x)
 	}
 #undef SFMULT
 }
-#endif // ESLOPE
 
 void R_DrawSinglePlane(visplane_t *pl)
 {
@@ -1087,10 +1069,8 @@ void R_DrawSinglePlane(visplane_t *pl)
 	}
 	else light = (pl->lightlevel >> LIGHTSEGSHIFT);
 
-#ifdef ESLOPE
-	if (!pl->slope) // Don't mess with angle on slopes! We'll handle this ourselves later
-#endif
-	if (viewangle != pl->viewangle+pl->plangle)
+	if (!pl->slope // Don't mess with angle on slopes! We'll handle this ourselves later
+		&& viewangle != pl->viewangle+pl->plangle)
 	{
 		memset(cachedheight, 0, sizeof (cachedheight));
 		angle = (pl->viewangle+pl->plangle-ANGLE_90)>>ANGLETOFINESHIFT;
@@ -1148,7 +1128,6 @@ void R_DrawSinglePlane(visplane_t *pl)
 	if (light < 0)
 		light = 0;
 
-#ifdef ESLOPE
 	if (pl->slope)
 	{
 		float fudgecanyon = 0;
@@ -1248,10 +1227,9 @@ void R_DrawSinglePlane(visplane_t *pl)
 			spanfunctype = SPANDRAWFUNC_TILTED;
 
 		planezlight = scalelight[light];
-	} else
-#endif // ESLOPE
-
-	planezlight = zlight[light];
+	}
+	else
+		planezlight = zlight[light];
 
 	// Use the correct span drawer depending on the powers-of-twoness
 	if (!ds_powersoftwo)
diff --git a/src/r_plane.h b/src/r_plane.h
index 405dd9726a543889a47474891d209550a8c77ec4..a1a5b7a78388bb7c835ab4763329731514f990a2 100644
--- a/src/r_plane.h
+++ b/src/r_plane.h
@@ -50,9 +50,7 @@ typedef struct visplane_s
 #ifdef POLYOBJECTS_PLANES
 	polyobj_t *polyobj;
 #endif
-#ifdef ESLOPE
 	pslope_t *slope;
-#endif
 } visplane_t;
 
 extern visplane_t *visplanes[MAXVISPLANES];
@@ -86,10 +84,7 @@ visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel, fixed_t
 #ifdef POLYOBJECTS_PLANES
 	, polyobj_t *polyobj
 #endif
-#ifdef ESLOPE
-	, pslope_t *slope
-#endif
-	);
+	, pslope_t *slope);
 visplane_t *R_CheckPlane(visplane_t *pl, INT32 start, INT32 stop);
 void R_ExpandPlane(visplane_t *pl, INT32 start, INT32 stop);
 void R_PlaneBounds(visplane_t *plane);
@@ -110,13 +105,11 @@ typedef struct planemgr_s
 	INT16 f_clip[MAXVIDWIDTH];
 	INT16 c_clip[MAXVIDWIDTH];
 
-#ifdef ESLOPE
 	// For slope rendering; the height at the other end
 	fixed_t f_pos_slope;
 	fixed_t b_pos_slope;
 
 	struct pslope_s *slope;
-#endif
 
 	struct ffloor_s *ffloor;
 #ifdef POLYOBJECTS_PLANES
diff --git a/src/r_segs.c b/src/r_segs.c
index 6674f426ae763e762703cde7d7121d3aa4279d6d..fb3e02dbbc2a30de9f252867e8f28ddec41aec33 100644
--- a/src/r_segs.c
+++ b/src/r_segs.c
@@ -52,20 +52,16 @@ static fixed_t rw_offset2; // for splats
 static fixed_t rw_scale, rw_scalestep;
 static fixed_t rw_midtexturemid, rw_toptexturemid, rw_bottomtexturemid;
 static INT32 worldtop, worldbottom, worldhigh, worldlow;
-#ifdef ESLOPE
 static INT32 worldtopslope, worldbottomslope, worldhighslope, worldlowslope; // worldtop/bottom at end of slope
 static fixed_t rw_toptextureslide, rw_midtextureslide, rw_bottomtextureslide; // Defines how to adjust Y offsets along the wall for slopes
 static fixed_t rw_midtextureback, rw_midtexturebackslide; // Values for masked midtexture height calculation
-#endif
 static fixed_t pixhigh, pixlow, pixhighstep, pixlowstep;
 static fixed_t topfrac, topstep;
 static fixed_t bottomfrac, bottomstep;
 
 static lighttable_t **walllights;
 static INT16 *maskedtexturecol;
-#ifdef ESLOPE
 static fixed_t *maskedtextureheight = NULL;
-#endif
 
 // ==========================================================================
 // R_Splats Wall Splats Drawer
@@ -304,9 +300,7 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2)
 	sector_t *front, *back;
 	INT32 times, repeats;
 	INT64 overflow_test;
-#ifdef ESLOPE
 	INT32 range;
-#endif
 
 	// Calculate light table.
 	// Use different light tables
@@ -347,9 +341,7 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2)
 		colfunc = colfuncs[COLDRAWFUNC_FUZZY];
 	}
 
-#ifdef ESLOPE
 	range = max(ds->x2-ds->x1, 1);
-#endif
 	rw_scalestep = ds->scalestep;
 	spryscale = ds->scale1 + (x1 - ds->x1)*rw_scalestep;
 
@@ -387,12 +379,9 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2)
 
 		for (i = 0; i < dc_numlights; i++)
 		{
-#ifdef ESLOPE
 			fixed_t leftheight, rightheight;
-#endif
 			light = &frontsector->lightlist[i];
 			rlight = &dc_lightlist[i];
-#ifdef ESLOPE
 			if (light->slope) {
 				leftheight = P_GetZAt(light->slope, ds->leftpos.x, ds->leftpos.y);
 				rightheight = P_GetZAt(light->slope, ds->rightpos.x, ds->rightpos.y);
@@ -407,10 +396,6 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2)
 			rlight->heightstep = (rlight->heightstep-rlight->height)/(range);
 			//if (x1 > ds->x1)
 				//rlight->height -= (x1 - ds->x1)*rlight->heightstep;
-#else
-			rlight->height = (centeryfrac) - FixedMul((light->height - viewz), spryscale);
-			rlight->heightstep = -FixedMul(rw_scalestep, (light->height - viewz));
-#endif
 			rlight->startheight = rlight->height; // keep starting value here to reset for each repeat
 			rlight->lightlevel = *light->lightlevel;
 			rlight->extra_colormap = *light->extra_colormap;
@@ -511,40 +496,17 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2)
 			}
 		}
 
-#ifndef ESLOPE
-		if (curline->linedef->flags & ML_DONTPEGBOTTOM)
-		{
-			dc_texturemid = front->floorheight > back->floorheight
-				? front->floorheight : back->floorheight;
-			dc_texturemid = dc_texturemid + textureheight[texnum] - viewz;
-		}
-		else
-		{
-			dc_texturemid = front->ceilingheight < back->ceilingheight
-				? front->ceilingheight : back->ceilingheight;
-			dc_texturemid = dc_texturemid - viewz;
-		}
-		dc_texturemid += curline->sidedef->rowoffset;
-
-		if (curline->linedef->flags & ML_DONTPEGBOTTOM)
-			dc_texturemid += (textureheight[texnum])*times;
-		else
-			dc_texturemid -= (textureheight[texnum])*times;
-#endif
-
 		dc_texheight = textureheight[texnum]>>FRACBITS;
 
 		// draw the columns
 		for (dc_x = x1; dc_x <= x2; dc_x++)
 		{
-#ifdef ESLOPE
 			dc_texturemid = ds->maskedtextureheight[dc_x];
 
 			if (!!(curline->linedef->flags & ML_DONTPEGBOTTOM) ^ !!(curline->linedef->flags & ML_EFFECT3))
 				dc_texturemid += (textureheight[texnum])*times + textureheight[texnum];
 			else
 				dc_texturemid -= (textureheight[texnum])*times;
-#endif
 			// calculate lighting
 			if (maskedtexturecol[dc_x] != INT16_MAX)
 			{
@@ -753,14 +715,8 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
 	fixed_t         offsetvalue = 0;
 	lightlist_t     *light;
 	r_lightlist_t   *rlight;
-#ifdef ESLOPE
 	INT32           range;
-#endif
-#ifndef ESLOPE
-	fixed_t         lheight;
-#endif
 	line_t          *newline = NULL;
-#ifdef ESLOPE
 	// Render FOF sides kinda like normal sides, with the frac and step and everything
 	// NOTE: INT64 instead of fixed_t because overflow concerns
 	INT64         top_frac, top_step, bottom_frac, bottom_step;
@@ -770,7 +726,6 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
 	INT32         oldx = -1;
 	fixed_t       left_top, left_bottom; // needed here for slope skewing
 	pslope_t      *skewslope = NULL;
-#endif
 
 	void (*colfunc_2s) (column_t *);
 
@@ -827,9 +782,7 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
 	else if (pfloor->flags & FF_FOG)
 		colfunc = colfuncs[COLDRAWFUNC_FOG];
 
-#ifdef ESLOPE
 	range = max(ds->x2-ds->x1, 1);
-#endif
 	//SoM: Moved these up here so they are available for my lightlist calculations
 	rw_scalestep = ds->scalestep;
 	spryscale = ds->scale1 + (x1 - ds->x1)*rw_scalestep;
@@ -846,14 +799,11 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
 
 		for (i = p = 0; i < dc_numlights; i++)
 		{
-#ifdef ESLOPE
 			fixed_t leftheight, rightheight;
 			fixed_t pfloorleft, pfloorright;
 			INT64 overflow_test;
-#endif
 			light = &frontsector->lightlist[i];
 			rlight = &dc_lightlist[p];
-#ifdef ESLOPE
 
 #define SLOPEPARAMS(slope, end1, end2, normalheight) \
 	if (slope) { \
@@ -894,21 +844,9 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
 			else if (overflow_test > (INT64)CLAMPMIN) rlight->heightstep = (fixed_t)overflow_test;
 			else                                      rlight->heightstep = CLAMPMIN;
 			rlight->heightstep = (rlight->heightstep-rlight->height)/(range);
-#else
-			if (light->height < *pfloor->bottomheight)
-				continue;
-
-			if (light->height > *pfloor->topheight && i+1 < dc_numlights && frontsector->lightlist[i+1].height > *pfloor->topheight)
-				continue;
-
-			lheight = light->height;// > *pfloor->topheight ? *pfloor->topheight + FRACUNIT : light->height;
-			rlight->heightstep = -FixedMul (rw_scalestep, (lheight - viewz));
-			rlight->height = (centeryfrac) - FixedMul((lheight - viewz), spryscale);
-#endif
 			rlight->flags = light->flags;
 			if (light->flags & FF_CUTLEVEL)
 			{
-#ifdef ESLOPE
 				SLOPEPARAMS(*light->caster->b_slope, leftheight, rightheight, *light->caster->bottomheight)
 #undef SLOPEPARAMS
 				leftheight -= viewz;
@@ -925,11 +863,6 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
 				else if (overflow_test > (INT64)CLAMPMIN) rlight->botheightstep = (fixed_t)overflow_test;
 				else                                      rlight->botheightstep = CLAMPMIN;
 				rlight->botheightstep = (rlight->botheightstep-rlight->botheight)/(range);
-#else
-				lheight = *light->caster->bottomheight;// > *pfloor->topheight ? *pfloor->topheight + FRACUNIT : *light->caster->bottomheight;
-				rlight->botheightstep = -FixedMul (rw_scalestep, (lheight - viewz));
-				rlight->botheight = (centeryfrac) - FixedMul((lheight - viewz), spryscale);
-#endif
 			}
 
 			rlight->lightlevel = *light->lightlevel;
@@ -986,7 +919,6 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
 	mceilingclip = ds->sprtopclip;
 	dc_texheight = textureheight[texnum]>>FRACBITS;
 
-#ifdef ESLOPE
 	// calculate both left ends
 	if (*pfloor->t_slope)
 		left_top = P_GetZAt(*pfloor->t_slope, ds->leftpos.x, ds->leftpos.y) - viewz;
@@ -1009,21 +941,18 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
 	if (slopeskew)
 		dc_texturemid = left_top;
 	else
-#endif
-	dc_texturemid = *pfloor->topheight - viewz;
+		dc_texturemid = *pfloor->topheight - viewz;
 
 	if (newline)
 	{
 		offsetvalue = sides[newline->sidenum[0]].rowoffset;
 		if (newline->flags & ML_DONTPEGBOTTOM)
 		{
-#ifdef ESLOPE
 			skewslope = *pfloor->b_slope; // skew using bottom slope
 			if (slopeskew)
 				dc_texturemid = left_bottom;
 			else
-#endif
-			offsetvalue -= *pfloor->topheight - *pfloor->bottomheight;
+				offsetvalue -= *pfloor->topheight - *pfloor->bottomheight;
 		}
 	}
 	else
@@ -1031,17 +960,14 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
 		offsetvalue = sides[pfloor->master->sidenum[0]].rowoffset;
 		if (curline->linedef->flags & ML_DONTPEGBOTTOM)
 		{
-#ifdef ESLOPE
 			skewslope = *pfloor->b_slope; // skew using bottom slope
 			if (slopeskew)
 				dc_texturemid = left_bottom;
 			else
-#endif
-			offsetvalue -= *pfloor->topheight - *pfloor->bottomheight;
+				offsetvalue -= *pfloor->topheight - *pfloor->bottomheight;
 		}
 	}
 
-#ifdef ESLOPE
 	if (slopeskew)
 	{
 		angle_t lineangle = R_PointToAngle2(curline->v1->x, curline->v1->y, curline->v2->x, curline->v2->y);
@@ -1049,7 +975,6 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
 		if (skewslope)
 			ffloortextureslide = FixedMul(skewslope->zdelta, FINECOSINE((lineangle-skewslope->xydirection)>>ANGLETOFINESHIFT));
 	}
-#endif
 
 	dc_texturemid += offsetvalue;
 
@@ -1074,7 +999,6 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
 		column2s_length = textures[texnum]->height;
 	}
 
-#ifdef ESLOPE
 	// Set heights according to plane, or slope, whichever
 	{
 		fixed_t right_top, right_bottom;
@@ -1102,24 +1026,20 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
 		top_frac += top_step * (x1 - ds->x1);
 		bottom_frac += bottom_step * (x1 - ds->x1);
 	}
-#endif
 
 	// draw the columns
 	for (dc_x = x1; dc_x <= x2; dc_x++)
 	{
 		if (maskedtexturecol[dc_x] != INT16_MAX)
 		{
-#ifdef ESLOPE
 			if (ffloortextureslide) { // skew FOF walls
 				if (oldx != -1)
 					dc_texturemid += FixedMul(ffloortextureslide, (maskedtexturecol[oldx]-maskedtexturecol[dc_x])<<FRACBITS);
 				oldx = dc_x;
 			}
-#endif
 			// Calculate bounds
 			// clamp the values if necessary to avoid overflows and rendering glitches caused by them
 
-#ifdef ESLOPE
 			if      (top_frac > (INT64)CLAMPMAX) sprtopscreen = windowtop = CLAMPMAX;
 			else if (top_frac > (INT64)CLAMPMIN) sprtopscreen = windowtop = (fixed_t)top_frac;
 			else                                 sprtopscreen = windowtop = CLAMPMIN;
@@ -1129,10 +1049,6 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
 
 			top_frac += top_step;
 			bottom_frac += bottom_step;
-#else
-			sprtopscreen = windowtop = (centeryfrac - FixedMul((dc_texturemid - offsetvalue), spryscale));
-			sprbotscreen = windowbottom = FixedMul(*pfloor->topheight - *pfloor->bottomheight, spryscale) + sprtopscreen;
-#endif
 
 			// SoM: If column is out of range, why bother with it??
 			if (windowbottom < topbounds || windowtop > bottombounds)
@@ -1342,9 +1258,7 @@ static void R_RenderSegLoop (void)
 
 	INT32     mid;
 	fixed_t texturecolumn = 0;
-#ifdef ESLOPE
 	fixed_t oldtexturecolumn = -1;
-#endif
 	INT32     top;
 	INT32     bottom;
 	INT32     i;
@@ -1464,7 +1378,6 @@ static void R_RenderSegLoop (void)
 		angle = (rw_centerangle + xtoviewangle[rw_x])>>ANGLETOFINESHIFT;
 		texturecolumn = rw_offset-FixedMul(FINETANGENT(angle),rw_distance);
 
-#ifdef ESLOPE
 		if (oldtexturecolumn != -1) {
 			rw_bottomtexturemid += FixedMul(rw_bottomtextureslide,  oldtexturecolumn-texturecolumn);
 			rw_midtexturemid    += FixedMul(rw_midtextureslide,     oldtexturecolumn-texturecolumn);
@@ -1472,7 +1385,6 @@ static void R_RenderSegLoop (void)
 			rw_midtextureback   += FixedMul(rw_midtexturebackslide, oldtexturecolumn-texturecolumn);
 		}
 		oldtexturecolumn = texturecolumn;
-#endif
 
 		texturecolumn >>= FRACBITS;
 
@@ -1648,13 +1560,11 @@ static void R_RenderSegLoop (void)
 			//  for backdrawing of masked mid texture
 			maskedtexturecol[rw_x] = (INT16)texturecolumn;
 
-#ifdef ESLOPE
 			if (maskedtextureheight != NULL) {
 				maskedtextureheight[rw_x] = (!!(curline->linedef->flags & ML_DONTPEGBOTTOM) ^ !!(curline->linedef->flags & ML_EFFECT3) ?
 											max(rw_midtexturemid, rw_midtextureback) :
 											min(rw_midtexturemid, rw_midtextureback));
 			}
-#endif
 		}
 
 		if (dc_numlights)
@@ -1710,26 +1620,19 @@ void R_StoreWallRange(INT32 start, INT32 stop)
 	fixed_t       sineval;
 	angle_t       distangle, offsetangle;
 	boolean longboi;
-#ifndef ESLOPE
-	fixed_t       vtop;
-#endif
 	INT32           lightnum;
 	INT32           i, p;
 	lightlist_t   *light;
 	r_lightlist_t *rlight;
 	INT32 range;
-#ifdef ESLOPE
 	vertex_t segleft, segright;
 	fixed_t ceilingfrontslide, floorfrontslide, ceilingbackslide, floorbackslide;
-#endif
 	static size_t maxdrawsegs = 0;
 
-#ifdef ESLOPE
 	maskedtextureheight = NULL;
 	//initialize segleft and segright
 	memset(&segleft, 0x00, sizeof(segleft));
 	memset(&segright, 0x00, sizeof(segright));
-#endif
 
 	colfunc = colfuncs[BASEDRAWFUNC];
 
@@ -1839,7 +1742,6 @@ void R_StoreWallRange(INT32 start, INT32 stop)
 
 	// calculate texture boundaries
 	//  and decide if floor / ceiling marks are needed
-#ifdef ESLOPE
 	// Figure out map coordinates of where start and end are mapping to on seg, so we can clip right for slope bullshit
 	if (frontsector->hasslope || (backsector && backsector->hasslope)) // Commenting this out for FOFslop. -Red
 	{
@@ -1906,10 +1808,6 @@ void R_StoreWallRange(INT32 start, INT32 stop)
 	worldtopslope -= viewz;
 	worldbottom -= viewz;
 	worldbottomslope -= viewz;
-#else
-	worldtop = frontsector->ceilingheight - viewz;
-	worldbottom = frontsector->floorheight - viewz;
-#endif
 
 	midtexture = toptexture = bottomtexture = maskedtexture = 0;
 	ds_p->maskedtexturecol = NULL;
@@ -1931,18 +1829,15 @@ void R_StoreWallRange(INT32 start, INT32 stop)
 				continue;
 #endif
 
-#ifdef ESLOPE
 			if (ffloor[i].slope) {
 				ffloor[i].f_pos = P_GetZAt(ffloor[i].slope, segleft.x, segleft.y) - viewz;
 				ffloor[i].f_pos_slope = P_GetZAt(ffloor[i].slope, segright.x, segright.y) - viewz;
-			} else
-				ffloor[i].f_pos_slope =
-#endif
-			ffloor[i].f_pos = ffloor[i].height - viewz;
+			}
+			else
+				ffloor[i].f_pos_slope = ffloor[i].f_pos = ffloor[i].height - viewz;
 		}
 	}
 
-#ifdef ESLOPE
 	// Set up texture Y offset slides for sloped walls
 	rw_toptextureslide = rw_midtextureslide = rw_bottomtextureslide = 0;
 	ceilingfrontslide = floorfrontslide = ceilingbackslide = floorbackslide = 0;
@@ -1962,7 +1857,6 @@ void R_StoreWallRange(INT32 start, INT32 stop)
 		if (backsector && backsector->c_slope)
 			ceilingbackslide = FixedMul(backsector->c_slope->zdelta, FINECOSINE((lineangle-backsector->c_slope->xydirection)>>ANGLETOFINESHIFT));
 	}
-#endif
 
 	if (!backsector)
 	{
@@ -1972,33 +1866,22 @@ void R_StoreWallRange(INT32 start, INT32 stop)
 		texheight = textureheight[midtexture];
 		// a single sided line is terminal, so it must mark ends
 		markfloor = markceiling = true;
-#ifdef ESLOPE
 		if (linedef->flags & ML_EFFECT2) {
 			if (linedef->flags & ML_DONTPEGBOTTOM)
 				rw_midtexturemid = frontsector->floorheight + texheight - viewz;
 			else
 				rw_midtexturemid = frontsector->ceilingheight - viewz;
 		}
-		else
-#endif
-		if (linedef->flags & ML_DONTPEGBOTTOM)
+		else if (linedef->flags & ML_DONTPEGBOTTOM)
 		{
-#ifdef ESLOPE
 			rw_midtexturemid = worldbottom + texheight;
 			rw_midtextureslide = floorfrontslide;
-#else
-			vtop = frontsector->floorheight + texheight;
-			// bottom of texture at bottom
-			rw_midtexturemid = vtop - viewz;
-#endif
 		}
 		else
 		{
 			// top of texture at top
 			rw_midtexturemid = worldtop;
-#ifdef ESLOPE
 			rw_midtextureslide = ceilingfrontslide;
-#endif
 		}
 		rw_midtexturemid += sidedef->rowoffset;
 
@@ -2014,17 +1897,12 @@ void R_StoreWallRange(INT32 start, INT32 stop)
 		boolean bothceilingssky = false; // turned on if both back and front ceilings are sky
 		boolean bothfloorssky = false; // likewise, but for floors
 
-#ifdef ESLOPE
 		SLOPEPARAMS(backsector->c_slope, worldhigh, worldhighslope, backsector->ceilingheight)
 		SLOPEPARAMS(backsector->f_slope, worldlow,  worldlowslope,  backsector->floorheight)
 		worldhigh -= viewz;
 		worldhighslope -= viewz;
 		worldlow -= viewz;
 		worldlowslope -= viewz;
-#else
-		worldhigh = backsector->ceilingheight - viewz;
-		worldlow = backsector->floorheight - viewz;
-#endif
 
 		// hack to allow height changes in outdoor areas
 		// This is what gets rid of the upper textures if there should be sky
@@ -2046,27 +1924,15 @@ void R_StoreWallRange(INT32 start, INT32 stop)
 
 		if (!bothfloorssky)
 		{
-			if (
-#ifdef ESLOPE
-				worldbottomslope > worldlowslope ||
-#endif
-				worldbottom > worldlow)
+			if (worldbottomslope > worldlowslope || worldbottom > worldlow)
 			{
 				ds_p->silhouette = SIL_BOTTOM;
-#ifdef ESLOPE
 				if ((backsector->f_slope ? P_GetZAt(backsector->f_slope, viewx, viewy) : backsector->floorheight) > viewz)
 					ds_p->bsilheight = INT32_MAX;
 				else
 					ds_p->bsilheight = (frontsector->f_slope ? INT32_MAX : frontsector->floorheight);
-#else
-				ds_p->bsilheight = frontsector->floorheight;
-#endif
 			}
-#ifdef ESLOPE
 			else if ((backsector->f_slope ? P_GetZAt(backsector->f_slope, viewx, viewy) : backsector->floorheight) > viewz)
-#else
-			else if (backsector->floorheight > viewz)
-#endif
 			{
 				ds_p->silhouette = SIL_BOTTOM;
 				ds_p->bsilheight = INT32_MAX;
@@ -2076,27 +1942,15 @@ void R_StoreWallRange(INT32 start, INT32 stop)
 
 		if (!bothceilingssky)
 		{
-			if (
-#ifdef ESLOPE
-				worldtopslope < worldhighslope ||
-#endif
-				worldtop < worldhigh)
+			if (worldtopslope < worldhighslope || worldtop < worldhigh)
 			{
 				ds_p->silhouette |= SIL_TOP;
-#ifdef ESLOPE
 				if ((backsector->c_slope ? P_GetZAt(backsector->c_slope, viewx, viewy) : backsector->ceilingheight) < viewz)
 					ds_p->tsilheight = INT32_MIN;
 				else
 					ds_p->tsilheight = (frontsector->c_slope ? INT32_MIN : frontsector->ceilingheight);
-#else
-				ds_p->tsilheight = frontsector->ceilingheight;
-#endif
 			}
-#ifdef ESLOPE
 			else if ((backsector->c_slope ? P_GetZAt(backsector->c_slope, viewx, viewy) : backsector->ceilingheight) < viewz)
-#else
-			else if (backsector->ceilingheight < viewz)
-#endif
 			{
 				ds_p->silhouette |= SIL_TOP;
 				ds_p->tsilheight = INT32_MIN;
@@ -2106,22 +1960,14 @@ void R_StoreWallRange(INT32 start, INT32 stop)
 
 		if (!bothceilingssky && !bothfloorssky)
 		{
-#ifdef ESLOPE
 			if (worldhigh <= worldbottom && worldhighslope <= worldbottomslope)
-#else
-			if (worldhigh <= worldbottom)
-#endif
 			{
 				ds_p->sprbottomclip = negonearray;
 				ds_p->bsilheight = INT32_MAX;
 				ds_p->silhouette |= SIL_BOTTOM;
 			}
 
-#ifdef ESLOPE
 			if (worldlow >= worldtop && worldlowslope >= worldtopslope)
-#else
-			if (worldlow >= worldtop)
-#endif
 			{
 				ds_p->sprtopclip = screenheightarray;
 				ds_p->tsilheight = INT32_MIN;
@@ -2134,21 +1980,13 @@ void R_StoreWallRange(INT32 start, INT32 stop)
 		// Without the following code, sprites get displayed behind closed doors.
 		if (!bothceilingssky && !bothfloorssky)
 		{
-#ifdef ESLOPE
 			if (doorclosed || (worldhigh <= worldbottom && worldhighslope <= worldbottomslope))
-#else
-			if (doorclosed || backsector->ceilingheight <= frontsector->floorheight)
-#endif
 			{
 				ds_p->sprbottomclip = negonearray;
 				ds_p->bsilheight = INT32_MAX;
 				ds_p->silhouette |= SIL_BOTTOM;
 			}
-#ifdef ESLOPE
 			if (doorclosed || (worldlow >= worldtop && worldlowslope >= worldtopslope))
-#else
-			if (doorclosed || backsector->floorheight >= frontsector->ceilingheight)
-#endif
 			{                   // killough 1/17/98, 2/8/98
 				ds_p->sprtopclip = screenheightarray;
 				ds_p->tsilheight = INT32_MIN;
@@ -2163,10 +2001,8 @@ void R_StoreWallRange(INT32 start, INT32 stop)
 			markfloor = false;
 		}
 		else if (worldlow != worldbottom
-#ifdef ESLOPE
 			|| worldlowslope != worldbottomslope
 			|| backsector->f_slope != frontsector->f_slope
-#endif
 		    || backsector->floorpic != frontsector->floorpic
 		    || backsector->lightlevel != frontsector->lightlevel
 		    //SoM: 3/22/2000: Check floor x and y offsets.
@@ -2196,10 +2032,8 @@ void R_StoreWallRange(INT32 start, INT32 stop)
 			markceiling = false;
 		}
 		else if (worldhigh != worldtop
-#ifdef ESLOPE
 			|| worldhighslope != worldtopslope
 			|| backsector->c_slope != frontsector->c_slope
-#endif
 		    || backsector->ceilingpic != frontsector->ceilingpic
 		    || backsector->lightlevel != frontsector->lightlevel
 		    //SoM: 3/22/2000: Check floor x and y offsets.
@@ -2223,13 +2057,8 @@ void R_StoreWallRange(INT32 start, INT32 stop)
 
 		if (!bothceilingssky && !bothfloorssky)
 		{
-#ifdef ESLOPE
 			if ((worldhigh <= worldbottom && worldhighslope <= worldbottomslope)
 			 || (worldlow >= worldtop && worldlowslope >= worldtopslope))
-#else
-			if (backsector->ceilingheight <= frontsector->floorheight
-			 || backsector->floorheight >= frontsector->ceilingheight)
-#endif
 			{
 				// closed door
 				markceiling = markfloor = true;
@@ -2238,11 +2067,7 @@ void R_StoreWallRange(INT32 start, INT32 stop)
 
 		// check TOP TEXTURE
 		if (!bothceilingssky // never draw the top texture if on
-			&& (worldhigh < worldtop
-#ifdef ESLOPE
-				|| worldhighslope < worldtopslope
-#endif
-			))
+			&& (worldhigh < worldtop || worldhighslope < worldtopslope))
 		{
 			fixed_t texheight;
 			// top texture
@@ -2262,67 +2087,47 @@ void R_StoreWallRange(INT32 start, INT32 stop)
 				toptexture = R_GetTextureNum(sidedef->toptexture);
 				texheight = textureheight[toptexture];
 			}
-#ifdef ESLOPE
 			if (!(linedef->flags & ML_EFFECT1)) { // Ignore slopes for lower/upper textures unless flag is checked
 				if (linedef->flags & ML_DONTPEGTOP)
 					rw_toptexturemid = frontsector->ceilingheight - viewz;
 				else
 					rw_toptexturemid = backsector->ceilingheight - viewz;
-			} else
-#endif
-			if (linedef->flags & ML_DONTPEGTOP)
+			}
+			else if (linedef->flags & ML_DONTPEGTOP)
 			{
 				// top of texture at top
 				rw_toptexturemid = worldtop;
-#ifdef ESLOPE
 				rw_toptextureslide = ceilingfrontslide;
-#endif
 			}
 			else
 			{
-#ifdef ESLOPE
 				rw_toptexturemid = worldhigh + texheight;
 				rw_toptextureslide = ceilingbackslide;
-#else
-				vtop = backsector->ceilingheight + texheight;
-				// bottom of texture
-				rw_toptexturemid = vtop - viewz;
-#endif
 			}
 		}
 		// check BOTTOM TEXTURE
 		if (!bothfloorssky // never draw the bottom texture if on
-			&& (worldlow > worldbottom
-#ifdef ESLOPE
-				|| worldlowslope > worldbottomslope
-#endif
-			))     //seulement si VISIBLE!!!
+			&& (worldlow > worldbottom || worldlowslope > worldbottomslope)) // Only if VISIBLE!!!
 		{
 			// bottom texture
 			bottomtexture = R_GetTextureNum(sidedef->bottomtexture);
 
-#ifdef ESLOPE
 			if (!(linedef->flags & ML_EFFECT1)) { // Ignore slopes for lower/upper textures unless flag is checked
 				if (linedef->flags & ML_DONTPEGBOTTOM)
 					rw_bottomtexturemid = frontsector->floorheight - viewz;
 				else
 					rw_bottomtexturemid = backsector->floorheight - viewz;
-			} else
-#endif
-			if (linedef->flags & ML_DONTPEGBOTTOM)
+			}
+			else if (linedef->flags & ML_DONTPEGBOTTOM)
 			{
 				// bottom of texture at bottom
 				// top of texture at top
 				rw_bottomtexturemid = worldbottom;
-#ifdef ESLOPE
 				rw_bottomtextureslide = floorfrontslide;
-#endif
 			}
 			else {   // top of texture at top
 				rw_bottomtexturemid = worldlow;
-#ifdef ESLOPE
 				rw_bottomtextureslide = floorbackslide;
-#endif
 			}
 		}
 
@@ -2335,12 +2140,10 @@ void R_StoreWallRange(INT32 start, INT32 stop)
 			ffloor_t *rover;
 			ffloor_t *r2;
 			fixed_t   lowcut, highcut;
-#ifdef ESLOPE
 			fixed_t lowcutslope, highcutslope;
 
 			// Used for height comparisons and etc across FOFs and slopes
 			fixed_t high1, highslope1, low1, lowslope1, high2, highslope2, low2, lowslope2;
-#endif
 
 			//markceiling = markfloor = true;
 			maskedtexture = true;
@@ -2350,10 +2153,8 @@ void R_StoreWallRange(INT32 start, INT32 stop)
 
 			lowcut = max(worldbottom, worldlow) + viewz;
 			highcut = min(worldtop, worldhigh) + viewz;
-#ifdef ESLOPE
 			lowcutslope = max(worldbottomslope, worldlowslope) + viewz;
 			highcutslope = min(worldtopslope, worldhighslope) + viewz;
-#endif
 
 			if (frontsector->ffloors && backsector->ffloors)
 			{
@@ -2368,16 +2169,11 @@ void R_StoreWallRange(INT32 start, INT32 stop)
 					if (rover->norender == leveltime)
 						continue;
 
-#ifdef ESLOPE
 					SLOPEPARAMS(*rover->t_slope, high1, highslope1, *rover->topheight)
 					SLOPEPARAMS(*rover->b_slope, low1,  lowslope1,  *rover->bottomheight)
 
 					if ((high1 < lowcut && highslope1 < lowcutslope) || (low1 > highcut && lowslope1 > highcutslope))
 						continue;
-#else
-					if (*rover->topheight < lowcut || *rover->bottomheight > highcut)
-						continue;
-#endif
 
 					for (r2 = frontsector->ffloors; r2; r2 = r2->next)
 					{
@@ -2401,7 +2197,6 @@ void R_StoreWallRange(INT32 start, INT32 stop)
 								continue;
 						}
 
-#ifdef ESLOPE
 						SLOPEPARAMS(*r2->t_slope, high2, highslope2, *r2->topheight)
 						SLOPEPARAMS(*r2->b_slope, low2,  lowslope2,  *r2->bottomheight)
 
@@ -2409,12 +2204,6 @@ void R_StoreWallRange(INT32 start, INT32 stop)
 							continue;
 						if ((high1 > high2 || highslope1 > highslope2) || (low1 < low2 || lowslope1 < lowslope2))
 							continue;
-#else
-						if (*r2->topheight < lowcut || *r2->bottomheight > highcut)
-							continue;
-						if (*rover->topheight > *r2->topheight || *rover->bottomheight < *r2->bottomheight)
-							continue;
-#endif
 
 						break;
 					}
@@ -2435,16 +2224,11 @@ void R_StoreWallRange(INT32 start, INT32 stop)
 					if (rover->norender == leveltime)
 						continue;
 
-#ifdef ESLOPE
 					SLOPEPARAMS(*rover->t_slope, high1, highslope1, *rover->topheight)
 					SLOPEPARAMS(*rover->b_slope, low1,  lowslope1,  *rover->bottomheight)
 
 					if ((high1 < lowcut && highslope1 < lowcutslope) || (low1 > highcut && lowslope1 > highcutslope))
 						continue;
-#else
-					if (*rover->topheight < lowcut || *rover->bottomheight > highcut)
-						continue;
-#endif
 
 					for (r2 = backsector->ffloors; r2; r2 = r2->next)
 					{
@@ -2468,7 +2252,6 @@ void R_StoreWallRange(INT32 start, INT32 stop)
 								continue;
 						}
 
-#ifdef ESLOPE
 						SLOPEPARAMS(*r2->t_slope, high2, highslope2, *r2->topheight)
 						SLOPEPARAMS(*r2->b_slope, low2,  lowslope2,  *r2->bottomheight)
 #undef SLOPEPARAMS
@@ -2476,12 +2259,6 @@ void R_StoreWallRange(INT32 start, INT32 stop)
 							continue;
 						if ((high1 > high2 || highslope1 > highslope2) || (low1 < low2 || lowslope1 < lowslope2))
 							continue;
-#else
-						if (*r2->topheight < lowcut || *r2->bottomheight > highcut)
-							continue;
-						if (*rover->topheight > *r2->topheight || *rover->bottomheight < *r2->bottomheight)
-							continue;
-#endif
 
 						break;
 					}
@@ -2501,17 +2278,12 @@ void R_StoreWallRange(INT32 start, INT32 stop)
 					if (rover->norender == leveltime)
 						continue;
 
-#ifdef ESLOPE
 					// Oy vey.
-					if ((	   (*rover->t_slope ? P_GetZAt(*rover->t_slope, segleft.x, segleft.y) : *rover->topheight) <= worldbottom+viewz
-							&& (*rover->t_slope ? P_GetZAt(*rover->t_slope, segright.x, segright.y) : *rover->topheight) <= worldbottomslope+viewz)
-							||((*rover->b_slope ? P_GetZAt(*rover->b_slope, segleft.x, segleft.y) : *rover->bottomheight) >= worldtop+viewz
-							&& (*rover->b_slope ? P_GetZAt(*rover->b_slope, segright.x, segright.y) : *rover->bottomheight) >= worldtopslope+viewz))
-						continue;
-#else
-					if (*rover->topheight <= frontsector->floorheight || *rover->bottomheight >= frontsector->ceilingheight)
+					if (      ((*rover->t_slope ? P_GetZAt(*rover->t_slope, segleft .x, segleft .y) : *rover->   topheight) <= worldbottom      + viewz
+					        && (*rover->t_slope ? P_GetZAt(*rover->t_slope, segright.x, segright.y) : *rover->   topheight) <= worldbottomslope + viewz)
+					        ||((*rover->b_slope ? P_GetZAt(*rover->b_slope, segleft .x, segleft .y) : *rover->bottomheight) >= worldtop         + viewz
+					        && (*rover->b_slope ? P_GetZAt(*rover->b_slope, segright.x, segright.y) : *rover->bottomheight) >= worldtopslope    + viewz))
 						continue;
-#endif
 
 					ds_p->thicksides[i] = rover;
 					i++;
@@ -2525,25 +2297,18 @@ void R_StoreWallRange(INT32 start, INT32 stop)
 						continue;
 					if (rover->norender == leveltime)
 						continue;
-#ifdef ESLOPE
 					// Oy vey.
-					if ((	   (*rover->t_slope ? P_GetZAt(*rover->t_slope, segleft.x, segleft.y) : *rover->topheight) <= worldbottom+viewz
-							&& (*rover->t_slope ? P_GetZAt(*rover->t_slope, segright.x, segright.y) : *rover->topheight) <= worldbottomslope+viewz)
-							||((*rover->b_slope ? P_GetZAt(*rover->b_slope, segleft.x, segleft.y) : *rover->bottomheight) >= worldtop+viewz
-							&& (*rover->b_slope ? P_GetZAt(*rover->b_slope, segright.x, segright.y) : *rover->bottomheight) >= worldtopslope+viewz))
+					if (      ((*rover->t_slope ? P_GetZAt(*rover->t_slope, segleft .x, segleft .y) : *rover->   topheight) <= worldbottom      + viewz
+					        && (*rover->t_slope ? P_GetZAt(*rover->t_slope, segright.x, segright.y) : *rover->   topheight) <= worldbottomslope + viewz)
+					        ||((*rover->b_slope ? P_GetZAt(*rover->b_slope, segleft .x, segleft .y) : *rover->bottomheight) >= worldtop         + viewz
+					        && (*rover->b_slope ? P_GetZAt(*rover->b_slope, segright.x, segright.y) : *rover->bottomheight) >= worldtopslope    + viewz))
 						continue;
 
-					if ((	   (*rover->t_slope ? P_GetZAt(*rover->t_slope, segleft.x, segleft.y) : *rover->topheight) <= worldlow+viewz
-							&& (*rover->t_slope ? P_GetZAt(*rover->t_slope, segright.x, segright.y) : *rover->topheight) <= worldlowslope+viewz)
-							||((*rover->b_slope ? P_GetZAt(*rover->b_slope, segleft.x, segleft.y) : *rover->bottomheight) >= worldhigh+viewz
-							&& (*rover->b_slope ? P_GetZAt(*rover->b_slope, segright.x, segright.y) : *rover->bottomheight) >= worldhighslope+viewz))
-						continue;
-#else
-					if (*rover->topheight <= frontsector->floorheight || *rover->bottomheight >= frontsector->ceilingheight)
+					if (      ((*rover->t_slope ? P_GetZAt(*rover->t_slope, segleft .x, segleft .y) : *rover->   topheight) <= worldlow       + viewz
+					        && (*rover->t_slope ? P_GetZAt(*rover->t_slope, segright.x, segright.y) : *rover->   topheight) <= worldlowslope  + viewz)
+					        ||((*rover->b_slope ? P_GetZAt(*rover->b_slope, segleft .x, segleft .y) : *rover->bottomheight) >= worldhigh      + viewz
+					        && (*rover->b_slope ? P_GetZAt(*rover->b_slope, segright.x, segright.y) : *rover->bottomheight) >= worldhighslope + viewz))
 						continue;
-					if (*rover->topheight <= backsector->floorheight || *rover->bottomheight >= backsector->ceilingheight)
-						continue;
-#endif
 
 					ds_p->thicksides[i] = rover;
 					i++;
@@ -2563,7 +2328,6 @@ void R_StoreWallRange(INT32 start, INT32 stop)
 			else
 				ds_p->maskedtexturecol = ds_p->thicksidecol;
 
-#ifdef ESLOPE
 			maskedtextureheight = ds_p->maskedtextureheight; // note to red, this == &(ds_p->maskedtextureheight[0])
 
 #ifdef POLYOBJECTS
@@ -2596,7 +2360,6 @@ void R_StoreWallRange(INT32 start, INT32 stop)
 			}
 			rw_midtexturemid += sidedef->rowoffset;
 			rw_midtextureback += sidedef->rowoffset;
-#endif
 
 			maskedtexture = true;
 		}
@@ -2660,22 +2423,16 @@ void R_StoreWallRange(INT32 start, INT32 stop)
 	//  and doesn't need to be marked.
 	if (frontsector->heightsec == -1)
 	{
-		if (frontsector->floorpic != skyflatnum
-		&& (
-#ifdef ESLOPE
-			frontsector->f_slope ? P_GetZAt(frontsector->f_slope, viewx, viewy) :
-#endif
+		if (frontsector->floorpic != skyflatnum && (frontsector->f_slope ?
+			P_GetZAt(frontsector->f_slope, viewx, viewy) :
 			frontsector->floorheight) >= viewz)
 		{
 			// above view plane
 			markfloor = false;
 		}
 
-		if (frontsector->ceilingpic != skyflatnum
-		&& (
-#ifdef ESLOPE
-			frontsector->c_slope ? P_GetZAt(frontsector->c_slope, viewx, viewy) :
-#endif
+		if (frontsector->ceilingpic != skyflatnum && (frontsector->c_slope ?
+			P_GetZAt(frontsector->c_slope, viewx, viewy) :
 			frontsector->ceilingheight) <= viewz)
 		{
 			// below view plane
@@ -2686,10 +2443,8 @@ void R_StoreWallRange(INT32 start, INT32 stop)
 	// calculate incremental stepping values for texture edges
 	worldtop >>= 4;
 	worldbottom >>= 4;
-#ifdef ESLOPE
 	worldtopslope >>= 4;
 	worldbottomslope >>= 4;
-#endif
 
 	if (linedef->special == HORIZONSPECIAL) { // HORIZON LINES
 		topstep = bottomstep = 0;
@@ -2702,7 +2457,6 @@ void R_StoreWallRange(INT32 start, INT32 stop)
 		bottomstep = -FixedMul (rw_scalestep,worldbottom);
 		bottomfrac = (centeryfrac>>4) - FixedMul (worldbottom, rw_scale);
 
-#ifdef ESLOPE
 		if (frontsector->c_slope) {
 			fixed_t topfracend = (centeryfrac>>4) - FixedMul (worldtopslope, ds_p->scale2);
 			topstep = (topfracend-topfrac)/(range);
@@ -2711,7 +2465,6 @@ void R_StoreWallRange(INT32 start, INT32 stop)
 			fixed_t bottomfracend = (centeryfrac>>4) - FixedMul (worldbottomslope, ds_p->scale2);
 			bottomstep = (bottomfracend-bottomfrac)/(range);
 		}
-#endif
 	}
 
 	dc_numlights = 0;
@@ -2727,14 +2480,11 @@ void R_StoreWallRange(INT32 start, INT32 stop)
 
 		for (i = p = 0; i < dc_numlights; i++)
 		{
-#ifdef ESLOPE
 			fixed_t leftheight, rightheight;
-#endif
 
 			light = &frontsector->lightlist[i];
 			rlight = &dc_lightlist[p];
 
-#ifdef ESLOPE
 			if (light->slope) {
 				leftheight = P_GetZAt(light->slope, segleft.x, segleft.y);
 				rightheight = P_GetZAt(light->slope, segright.x, segright.y);
@@ -2749,38 +2499,23 @@ void R_StoreWallRange(INT32 start, INT32 stop)
 
 			leftheight >>= 4;
 			rightheight >>= 4;
-#endif
 
 			if (i != 0)
 			{
-#ifdef ESLOPE
 				if (leftheight < worldbottom && rightheight < worldbottomslope)
 					continue;
 
 				if (leftheight > worldtop && rightheight > worldtopslope && i+1 < dc_numlights && frontsector->lightlist[i+1].height > frontsector->ceilingheight)
 					continue;
-#else
-				if (light->height < frontsector->floorheight)
-					continue;
-
-				if (light->height > frontsector->ceilingheight && i+1 < dc_numlights && frontsector->lightlist[i+1].height > frontsector->ceilingheight)
-					continue;
-#endif
 			}
 
-#ifdef ESLOPE
 			rlight->height = (centeryfrac>>4) - FixedMul(leftheight, rw_scale);
 			rlight->heightstep = (centeryfrac>>4) - FixedMul(rightheight, ds_p->scale2);
 			rlight->heightstep = (rlight->heightstep-rlight->height)/(range);
-#else
-			rlight->height = (centeryfrac>>4) - FixedMul((light->height - viewz) >> 4, rw_scale);
-			rlight->heightstep = -FixedMul (rw_scalestep, (light->height - viewz) >> 4);
-#endif
 			rlight->flags = light->flags;
 
 			if (light->caster && light->caster->flags & FF_CUTSOLIDS)
 			{
-#ifdef ESLOPE
 				if (*light->caster->b_slope) {
 					leftheight = P_GetZAt(*light->caster->b_slope, segleft.x, segleft.y);
 					rightheight = P_GetZAt(*light->caster->b_slope, segright.x, segright.y);
@@ -2800,10 +2535,6 @@ void R_StoreWallRange(INT32 start, INT32 stop)
 				rlight->botheightstep = (centeryfrac>>4) - FixedMul(rightheight, ds_p->scale2);
 				rlight->botheightstep = (rlight->botheightstep-rlight->botheight)/(range);
 
-#else
-				rlight->botheight = (centeryfrac >> 4) - FixedMul((*light->caster->bottomheight - viewz) >> 4, rw_scale);
-				rlight->botheightstep = -FixedMul (rw_scalestep, (*light->caster->bottomheight - viewz) >> 4);
-#endif
 			}
 
 			rlight->lightlevel = *light->lightlevel;
@@ -2819,9 +2550,7 @@ void R_StoreWallRange(INT32 start, INT32 stop)
 		for (i = 0; i < numffloors; i++)
 		{
 			ffloor[i].f_pos >>= 4;
-#ifdef ESLOPE
 			ffloor[i].f_pos_slope >>= 4;
-#endif
 			if (linedef->special == HORIZONSPECIAL) // Horizon lines extend FOFs in contact with them too.
 			{
 				ffloor[i].f_step = 0;
@@ -2830,13 +2559,8 @@ void R_StoreWallRange(INT32 start, INT32 stop)
 			}
 			else
 			{
-#ifdef ESLOPE
 				ffloor[i].f_frac = (centeryfrac>>4) - FixedMul(ffloor[i].f_pos, rw_scale);
 				ffloor[i].f_step = ((centeryfrac>>4) - FixedMul(ffloor[i].f_pos_slope, ds_p->scale2) - ffloor[i].f_frac)/(range);
-#else
-				ffloor[i].f_step = FixedMul(-rw_scalestep, ffloor[i].f_pos);
-				ffloor[i].f_frac = (centeryfrac>>4) - FixedMul(ffloor[i].f_pos, rw_scale);
-#endif
 			}
 		}
 	}
@@ -2845,42 +2569,34 @@ void R_StoreWallRange(INT32 start, INT32 stop)
 	{
 		worldhigh >>= 4;
 		worldlow >>= 4;
-#ifdef ESLOPE
 		worldhighslope >>= 4;
 		worldlowslope >>= 4;
-#endif
 
 		if (toptexture)
 		{
 			pixhigh = (centeryfrac>>4) - FixedMul (worldhigh, rw_scale);
 			pixhighstep = -FixedMul (rw_scalestep,worldhigh);
 
-#ifdef ESLOPE
 			if (backsector->c_slope) {
 				fixed_t topfracend = (centeryfrac>>4) - FixedMul (worldhighslope, ds_p->scale2);
 				pixhighstep = (topfracend-pixhigh)/(range);
 			}
-#endif
 		}
 
 		if (bottomtexture)
 		{
 			pixlow = (centeryfrac>>4) - FixedMul (worldlow, rw_scale);
 			pixlowstep = -FixedMul (rw_scalestep,worldlow);
-#ifdef ESLOPE
 			if (backsector->f_slope) {
 				fixed_t bottomfracend = (centeryfrac>>4) - FixedMul (worldlowslope, ds_p->scale2);
 				pixlowstep = (bottomfracend-pixlow)/(range);
 			}
-#endif
 		}
 
 		{
 			ffloor_t * rover;
-#ifdef ESLOPE
 			fixed_t roverleft, roverright;
 			fixed_t planevistest;
-#endif
 			i = 0;
 
 			if (backsector->ffloors)
@@ -2892,7 +2608,6 @@ void R_StoreWallRange(INT32 start, INT32 stop)
 					if (rover->norender == leveltime)
 						continue;
 
-#ifdef ESLOPE
 					// Let the renderer know this sector is sloped.
 					if (*rover->b_slope || *rover->t_slope)
 						backsector->hasslope = true;
@@ -2939,34 +2654,6 @@ void R_StoreWallRange(INT32 start, INT32 stop)
 						ffloor[i].b_step = (ffloor[i].b_step-ffloor[i].b_frac)/(range);
 						i++;
 					}
-#else
-					if (*rover->bottomheight <= backsector->ceilingheight &&
-					    *rover->bottomheight >= backsector->floorheight &&
-					    ((viewz < *rover->bottomheight && !(rover->flags & FF_INVERTPLANES)) ||
-					     (viewz > *rover->bottomheight && (rover->flags & FF_BOTHPLANES))))
-					{
-						ffloor[i].b_pos = *rover->bottomheight;
-						ffloor[i].b_pos = (ffloor[i].b_pos - viewz) >> 4;
-						ffloor[i].b_step = FixedMul(-rw_scalestep, ffloor[i].b_pos);
-						ffloor[i].b_frac = (centeryfrac >> 4) - FixedMul(ffloor[i].b_pos, rw_scale);
-						i++;
-					}
-
-					if (i >= MAXFFLOORS)
-						break;
-
-					if (*rover->topheight >= backsector->floorheight &&
-					    *rover->topheight <= backsector->ceilingheight &&
-					    ((viewz > *rover->topheight && !(rover->flags & FF_INVERTPLANES)) ||
-					     (viewz < *rover->topheight && (rover->flags & FF_BOTHPLANES))))
-					{
-						ffloor[i].b_pos = *rover->topheight;
-						ffloor[i].b_pos = (ffloor[i].b_pos - viewz) >> 4;
-						ffloor[i].b_step = FixedMul(-rw_scalestep, ffloor[i].b_pos);
-						ffloor[i].b_frac = (centeryfrac >> 4) - FixedMul(ffloor[i].b_pos, rw_scale);
-						i++;
-					}
-#endif
 				}
 			}
 			else if (frontsector && frontsector->ffloors)
@@ -2978,8 +2665,6 @@ void R_StoreWallRange(INT32 start, INT32 stop)
 					if (rover->norender == leveltime)
 						continue;
 
-
-#ifdef ESLOPE
 					// Let the renderer know this sector is sloped.
 					if (*rover->b_slope || *rover->t_slope)
 						frontsector->hasslope = true;
@@ -3026,32 +2711,6 @@ void R_StoreWallRange(INT32 start, INT32 stop)
 						ffloor[i].b_step = (ffloor[i].b_step-ffloor[i].b_frac)/(range);
 						i++;
 					}
-#else
-					if (*rover->bottomheight <= frontsector->ceilingheight &&
-					    *rover->bottomheight >= frontsector->floorheight &&
-					    ((viewz < *rover->bottomheight && !(rover->flags & FF_INVERTPLANES)) ||
-					     (viewz > *rover->bottomheight && (rover->flags & FF_BOTHPLANES))))
-					{
-						ffloor[i].b_pos = *rover->bottomheight;
-						ffloor[i].b_pos = (ffloor[i].b_pos - viewz) >> 4;
-						ffloor[i].b_step = FixedMul(-rw_scalestep, ffloor[i].b_pos);
-						ffloor[i].b_frac = (centeryfrac >> 4) - FixedMul(ffloor[i].b_pos, rw_scale);
-						i++;
-					}
-					if (i >= MAXFFLOORS)
-						break;
-					if (*rover->topheight >= frontsector->floorheight &&
-					    *rover->topheight <= frontsector->ceilingheight &&
-					    ((viewz > *rover->topheight && !(rover->flags & FF_INVERTPLANES)) ||
-					     (viewz < *rover->topheight && (rover->flags & FF_BOTHPLANES))))
-					{
-						ffloor[i].b_pos = *rover->topheight;
-						ffloor[i].b_pos = (ffloor[i].b_pos - viewz) >> 4;
-						ffloor[i].b_step = FixedMul(-rw_scalestep, ffloor[i].b_pos);
-						ffloor[i].b_frac = (centeryfrac >> 4) - FixedMul(ffloor[i].b_pos, rw_scale);
-						i++;
-					}
-#endif
 				}
 			}
 #ifdef POLYOBJECTS_PLANES
@@ -3068,9 +2727,7 @@ void R_StoreWallRange(INT32 start, INT32 stop)
 					if (ffloor[i].plane->maxx < ds_p->x2)
 						ffloor[i].plane->maxx = ds_p->x2;
 
-#ifdef ESLOPE
 					ffloor[i].slope = NULL;
-#endif
 					ffloor[i].b_pos = backsector->floorheight;
 					ffloor[i].b_pos = (ffloor[i].b_pos - viewz) >> 4;
 					ffloor[i].b_step = FixedMul(-rw_scalestep, ffloor[i].b_pos);
@@ -3087,9 +2744,7 @@ void R_StoreWallRange(INT32 start, INT32 stop)
 					if (ffloor[i].plane->maxx < ds_p->x2)
 						ffloor[i].plane->maxx = ds_p->x2;
 
-#ifdef ESLOPE
 					ffloor[i].slope = NULL;
-#endif
 					ffloor[i].b_pos = backsector->ceilingheight;
 					ffloor[i].b_pos = (ffloor[i].b_pos - viewz) >> 4;
 					ffloor[i].b_step = FixedMul(-rw_scalestep, ffloor[i].b_pos);
diff --git a/src/r_skins.c b/src/r_skins.c
new file mode 100644
index 0000000000000000000000000000000000000000..2e9548bd7cd0831469b3169f6618d726996ab4c6
--- /dev/null
+++ b/src/r_skins.c
@@ -0,0 +1,825 @@
+// SONIC ROBO BLAST 2
+//-----------------------------------------------------------------------------
+// Copyright (C) 1993-1996 by id Software, Inc.
+// Copyright (C) 1998-2000 by DooM Legacy Team.
+// Copyright (C) 1999-2020 by Sonic Team Junior.
+//
+// This program is free software distributed under the
+// terms of the GNU General Public License, version 2.
+// See the 'LICENSE' file for more details.
+//-----------------------------------------------------------------------------
+/// \file  r_skins.c
+/// \brief Loading skins
+
+#include "doomdef.h"
+#include "console.h"
+#include "g_game.h"
+#include "r_local.h"
+#include "st_stuff.h"
+#include "w_wad.h"
+#include "z_zone.h"
+#include "m_misc.h"
+#include "info.h" // spr2names
+#include "i_video.h" // rendermode
+#include "i_system.h"
+#include "r_things.h"
+#include "r_skins.h"
+#include "p_local.h"
+#include "dehacked.h" // get_number (for thok)
+#include "m_cond.h"
+#ifdef HWRENDER
+#include "hardware/hw_md2.h"
+#endif
+
+#ifdef PC_DOS
+#include <stdio.h> // for snprintf
+int	snprintf(char *str, size_t n, const char *fmt, ...);
+//int	vsnprintf(char *str, size_t n, const char *fmt, va_list ap);
+#endif
+
+INT32 numskins = 0;
+skin_t skins[MAXSKINS];
+
+// FIXTHIS: don't work because it must be inistilised before the config load
+//#define SKINVALUES
+#ifdef SKINVALUES
+CV_PossibleValue_t skin_cons_t[MAXSKINS+1];
+#endif
+
+//
+// P_GetSkinSprite2
+// For non-super players, tries each sprite2's immediate predecessor until it finds one with a number of frames or ends up at standing.
+// For super players, does the same as above - but tries the super equivalent for each sprite2 before the non-super version.
+//
+
+UINT8 P_GetSkinSprite2(skin_t *skin, UINT8 spr2, player_t *player)
+{
+	UINT8 super = 0, i = 0;
+
+	if (!skin)
+		return 0;
+
+	if ((playersprite_t)(spr2 & ~FF_SPR2SUPER) >= free_spr2)
+		return 0;
+
+	while (!skin->sprites[spr2].numframes
+		&& spr2 != SPR2_STND
+		&& ++i < 32) // recursion limiter
+	{
+		if (spr2 & FF_SPR2SUPER)
+		{
+			super = FF_SPR2SUPER;
+			spr2 &= ~FF_SPR2SUPER;
+			continue;
+		}
+
+		switch(spr2)
+		{
+		// Normal special cases.
+		case SPR2_JUMP:
+			spr2 = ((player
+					? player->charflags
+					: skin->flags)
+					& SF_NOJUMPSPIN) ? SPR2_SPNG : SPR2_ROLL;
+			break;
+		case SPR2_TIRE:
+			spr2 = ((player
+					? player->charability
+					: skin->ability)
+					== CA_SWIM) ? SPR2_SWIM : SPR2_FLY;
+			break;
+		// Use the handy list, that's what it's there for!
+		default:
+			spr2 = spr2defaults[spr2];
+			break;
+		}
+
+		spr2 |= super;
+	}
+
+	if (i >= 32) // probably an infinite loop...
+		return 0;
+
+	return spr2;
+}
+
+static void Sk_SetDefaultValue(skin_t *skin)
+{
+	INT32 i;
+	//
+	// set default skin values
+	//
+	memset(skin, 0, sizeof (skin_t));
+	snprintf(skin->name,
+		sizeof skin->name, "skin %u", (UINT32)(skin-skins));
+	skin->name[sizeof skin->name - 1] = '\0';
+	skin->wadnum = INT16_MAX;
+
+	skin->flags = 0;
+
+	strcpy(skin->realname, "Someone");
+	strcpy(skin->hudname, "???");
+
+	skin->starttranscolor = 96;
+	skin->prefcolor = SKINCOLOR_GREEN;
+	skin->supercolor = SKINCOLOR_SUPERGOLD1;
+	skin->prefoppositecolor = 0; // use tables
+
+	skin->normalspeed = 36<<FRACBITS;
+	skin->runspeed = 28<<FRACBITS;
+	skin->thrustfactor = 5;
+	skin->accelstart = 96;
+	skin->acceleration = 40;
+
+	skin->ability = CA_NONE;
+	skin->ability2 = CA2_SPINDASH;
+	skin->jumpfactor = FRACUNIT;
+	skin->actionspd = 30<<FRACBITS;
+	skin->mindash = 15<<FRACBITS;
+	skin->maxdash = 70<<FRACBITS;
+
+	skin->radius = mobjinfo[MT_PLAYER].radius;
+	skin->height = mobjinfo[MT_PLAYER].height;
+	skin->spinheight = FixedMul(skin->height, 2*FRACUNIT/3);
+
+	skin->shieldscale = FRACUNIT;
+	skin->camerascale = FRACUNIT;
+
+	skin->thokitem = -1;
+	skin->spinitem = -1;
+	skin->revitem = -1;
+	skin->followitem = 0;
+
+	skin->highresscale = FRACUNIT;
+	skin->contspeed = 17;
+	skin->contangle = 0;
+
+	skin->availability = 0;
+
+	for (i = 0; i < sfx_skinsoundslot0; i++)
+		if (S_sfx[i].skinsound != -1)
+			skin->soundsid[S_sfx[i].skinsound] = i;
+}
+
+//
+// Initialize the basic skins
+//
+void R_InitSkins(void)
+{
+#ifdef SKINVALUES
+	INT32 i;
+
+	for (i = 0; i <= MAXSKINS; i++)
+	{
+		skin_cons_t[i].value = 0;
+		skin_cons_t[i].strvalue = NULL;
+	}
+#endif
+
+	// no default skin!
+	numskins = 0;
+}
+
+UINT32 R_GetSkinAvailabilities(void)
+{
+	INT32 s;
+	UINT32 response = 0;
+
+	for (s = 0; s < MAXSKINS; s++)
+	{
+		if (skins[s].availability && unlockables[skins[s].availability - 1].unlocked)
+			response |= (1 << s);
+	}
+	return response;
+}
+
+// returns true if available in circumstances, otherwise nope
+// warning don't use with an invalid skinnum other than -1 which always returns true
+boolean R_SkinUsable(INT32 playernum, INT32 skinnum)
+{
+	return ((skinnum == -1) // Simplifies things elsewhere, since there's already plenty of checks for less-than-0...
+		|| (!skins[skinnum].availability)
+		|| (((netgame || multiplayer) && playernum != -1) ? (players[playernum].availabilities & (1 << skinnum)) : (unlockables[skins[skinnum].availability - 1].unlocked))
+		|| (modeattacking) // If you have someone else's run you might as well take a look
+		|| (Playing() && (R_SkinAvailable(mapheaderinfo[gamemap-1]->forcecharacter) == skinnum)) // Force 1.
+		|| (netgame && (cv_forceskin.value == skinnum)) // Force 2.
+		|| (metalrecording && skinnum == 5) // Force 3.
+		);
+}
+
+// returns true if the skin name is found (loaded from pwad)
+// warning return -1 if not found
+INT32 R_SkinAvailable(const char *name)
+{
+	INT32 i;
+
+	for (i = 0; i < numskins; i++)
+	{
+		// search in the skin list
+		if (stricmp(skins[i].name,name)==0)
+			return i;
+	}
+	return -1;
+}
+
+// network code calls this when a 'skin change' is received
+void SetPlayerSkin(INT32 playernum, const char *skinname)
+{
+	INT32 i = R_SkinAvailable(skinname);
+	player_t *player = &players[playernum];
+
+	if ((i != -1) && R_SkinUsable(playernum, i))
+	{
+		SetPlayerSkinByNum(playernum, i);
+		return;
+	}
+
+	if (P_IsLocalPlayer(player))
+		CONS_Alert(CONS_WARNING, M_GetText("Skin '%s' not found.\n"), skinname);
+	else if(server || IsPlayerAdmin(consoleplayer))
+		CONS_Alert(CONS_WARNING, M_GetText("Player %d (%s) skin '%s' not found\n"), playernum, player_names[playernum], skinname);
+
+	SetPlayerSkinByNum(playernum, 0);
+}
+
+// Same as SetPlayerSkin, but uses the skin #.
+// network code calls this when a 'skin change' is received
+void SetPlayerSkinByNum(INT32 playernum, INT32 skinnum)
+{
+	player_t *player = &players[playernum];
+	skin_t *skin = &skins[skinnum];
+	UINT8 newcolor = 0;
+
+	if (skinnum >= 0 && skinnum < numskins && R_SkinUsable(playernum, skinnum)) // Make sure it exists!
+	{
+		player->skin = skinnum;
+
+		player->camerascale = skin->camerascale;
+		player->shieldscale = skin->shieldscale;
+
+		player->charability = (UINT8)skin->ability;
+		player->charability2 = (UINT8)skin->ability2;
+
+		player->charflags = (UINT32)skin->flags;
+
+		player->thokitem = skin->thokitem < 0 ? (UINT32)mobjinfo[MT_PLAYER].painchance : (UINT32)skin->thokitem;
+		player->spinitem = skin->spinitem < 0 ? (UINT32)mobjinfo[MT_PLAYER].damage : (UINT32)skin->spinitem;
+		player->revitem = skin->revitem < 0 ? (mobjtype_t)mobjinfo[MT_PLAYER].raisestate : (UINT32)skin->revitem;
+		player->followitem = skin->followitem;
+
+		if (((player->powers[pw_shield] & SH_NOSTACK) == SH_PINK) && (player->revitem == MT_LHRT || player->spinitem == MT_LHRT || player->thokitem == MT_LHRT)) // Healers can't keep their buff.
+			player->powers[pw_shield] &= SH_STACK;
+
+		player->actionspd = skin->actionspd;
+		player->mindash = skin->mindash;
+		player->maxdash = skin->maxdash;
+
+		player->normalspeed = skin->normalspeed;
+		player->runspeed = skin->runspeed;
+		player->thrustfactor = skin->thrustfactor;
+		player->accelstart = skin->accelstart;
+		player->acceleration = skin->acceleration;
+
+		player->jumpfactor = skin->jumpfactor;
+
+		player->height = skin->height;
+		player->spinheight = skin->spinheight;
+
+		if (!(cv_debug || devparm) && !(netgame || multiplayer || demoplayback))
+		{
+			if (playernum == consoleplayer)
+				CV_StealthSetValue(&cv_playercolor, skin->prefcolor);
+			else if (playernum == secondarydisplayplayer)
+				CV_StealthSetValue(&cv_playercolor2, skin->prefcolor);
+			player->skincolor = newcolor = skin->prefcolor;
+		}
+
+		if (player->followmobj)
+		{
+			P_RemoveMobj(player->followmobj);
+			P_SetTarget(&player->followmobj, NULL);
+		}
+
+		if (player->mo)
+		{
+			fixed_t radius = FixedMul(skin->radius, player->mo->scale);
+			if ((player->powers[pw_carry] == CR_NIGHTSMODE) && (skin->sprites[SPR2_NFLY].numframes == 0)) // If you don't have a sprite for flying horizontally, use the default NiGHTS skin.
+			{
+				skin = &skins[DEFAULTNIGHTSSKIN];
+				player->followitem = skin->followitem;
+				if (!(cv_debug || devparm) && !(netgame || multiplayer || demoplayback))
+					newcolor = skin->prefcolor; // will be updated in thinker to flashing
+			}
+			player->mo->skin = skin;
+			if (newcolor)
+				player->mo->color = newcolor;
+			P_SetScale(player->mo, player->mo->scale);
+			player->mo->radius = radius;
+
+			P_SetPlayerMobjState(player->mo, player->mo->state-states); // Prevent visual errors when switching between skins with differing number of frames
+		}
+		return;
+	}
+
+	if (P_IsLocalPlayer(player))
+		CONS_Alert(CONS_WARNING, M_GetText("Requested skin %d not found\n"), skinnum);
+	else if(server || IsPlayerAdmin(consoleplayer))
+		CONS_Alert(CONS_WARNING, "Player %d (%s) skin %d not found\n", playernum, player_names[playernum], skinnum);
+	SetPlayerSkinByNum(playernum, 0); // not found put the sonic skin
+}
+
+//
+// Add skins from a pwad, each skin preceded by 'S_SKIN' marker
+//
+
+// Does the same is in w_wad, but check only for
+// the first 6 characters (this is so we can have S_SKIN1, S_SKIN2..
+// for wad editors that don't like multiple resources of the same name)
+//
+static UINT16 W_CheckForSkinMarkerInPwad(UINT16 wadid, UINT16 startlump)
+{
+	UINT16 i;
+	const char *S_SKIN = "S_SKIN";
+	lumpinfo_t *lump_p;
+
+	// scan forward, start at <startlump>
+	if (startlump < wadfiles[wadid]->numlumps)
+	{
+		lump_p = wadfiles[wadid]->lumpinfo + startlump;
+		for (i = startlump; i < wadfiles[wadid]->numlumps; i++, lump_p++)
+			if (memcmp(lump_p->name,S_SKIN,6)==0)
+				return i;
+	}
+	return INT16_MAX; // not found
+}
+
+#define HUDNAMEWRITE(value) STRBUFCPY(skin->hudname, value)
+
+// turn _ into spaces and . into katana dot
+#define SYMBOLCONVERT(name) for (value = name; *value; value++)\
+					{\
+						if (*value == '_') *value = ' ';\
+						else if (*value == '.') *value = '\x1E';\
+					}
+
+//
+// Patch skins from a pwad, each skin preceded by 'P_SKIN' marker
+//
+
+// Does the same is in w_wad, but check only for
+// the first 6 characters (this is so we can have P_SKIN1, P_SKIN2..
+// for wad editors that don't like multiple resources of the same name)
+//
+static UINT16 W_CheckForPatchSkinMarkerInPwad(UINT16 wadid, UINT16 startlump)
+{
+	UINT16 i;
+	const char *P_SKIN = "P_SKIN";
+	lumpinfo_t *lump_p;
+
+	// scan forward, start at <startlump>
+	if (startlump < wadfiles[wadid]->numlumps)
+	{
+		lump_p = wadfiles[wadid]->lumpinfo + startlump;
+		for (i = startlump; i < wadfiles[wadid]->numlumps; i++, lump_p++)
+			if (memcmp(lump_p->name,P_SKIN,6)==0)
+				return i;
+	}
+	return INT16_MAX; // not found
+}
+
+static void R_LoadSkinSprites(UINT16 wadnum, UINT16 *lump, UINT16 *lastlump, skin_t *skin)
+{
+	UINT16 newlastlump;
+	UINT8 sprite2;
+
+	*lump += 1; // start after S_SKIN
+	*lastlump = W_CheckNumForNamePwad("S_END",wadnum,*lump); // stop at S_END
+
+	// old wadding practices die hard -- stop at S_SKIN (or P_SKIN) or S_START if they come before S_END.
+	newlastlump = W_CheckForSkinMarkerInPwad(wadnum,*lump);
+	if (newlastlump < *lastlump) *lastlump = newlastlump;
+	newlastlump = W_CheckForPatchSkinMarkerInPwad(wadnum,*lump);
+	if (newlastlump < *lastlump) *lastlump = newlastlump;
+	newlastlump = W_CheckNumForNamePwad("S_START",wadnum,*lump);
+	if (newlastlump < *lastlump) *lastlump = newlastlump;
+
+	// ...and let's handle super, too
+	newlastlump = W_CheckNumForNamePwad("S_SUPER",wadnum,*lump);
+	if (newlastlump < *lastlump)
+	{
+		newlastlump++;
+		// load all sprite sets we are aware of... for super!
+		for (sprite2 = 0; sprite2 < free_spr2; sprite2++)
+			R_AddSingleSpriteDef(spr2names[sprite2], &skin->sprites[FF_SPR2SUPER|sprite2], wadnum, newlastlump, *lastlump);
+
+		newlastlump--;
+		*lastlump = newlastlump; // okay, make the normal sprite set loading end there
+	}
+
+	// load all sprite sets we are aware of... for normal stuff.
+	for (sprite2 = 0; sprite2 < free_spr2; sprite2++)
+		R_AddSingleSpriteDef(spr2names[sprite2], &skin->sprites[sprite2], wadnum, *lump, *lastlump);
+
+	if (skin->sprites[0].numframes == 0)
+		I_Error("R_LoadSkinSprites: no frames found for sprite SPR2_%s\n", spr2names[0]);
+}
+
+// returns whether found appropriate property
+static boolean R_ProcessPatchableFields(skin_t *skin, char *stoken, char *value)
+{
+	// custom translation table
+	if (!stricmp(stoken, "startcolor"))
+		skin->starttranscolor = atoi(value);
+
+#define FULLPROCESS(field) else if (!stricmp(stoken, #field)) skin->field = get_number(value);
+	// character type identification
+	FULLPROCESS(flags)
+	FULLPROCESS(ability)
+	FULLPROCESS(ability2)
+
+	FULLPROCESS(thokitem)
+	FULLPROCESS(spinitem)
+	FULLPROCESS(revitem)
+	FULLPROCESS(followitem)
+#undef FULLPROCESS
+
+#define GETFRACBITS(field) else if (!stricmp(stoken, #field)) skin->field = atoi(value)<<FRACBITS;
+	GETFRACBITS(normalspeed)
+	GETFRACBITS(runspeed)
+
+	GETFRACBITS(mindash)
+	GETFRACBITS(maxdash)
+	GETFRACBITS(actionspd)
+
+	GETFRACBITS(radius)
+	GETFRACBITS(height)
+	GETFRACBITS(spinheight)
+#undef GETFRACBITS
+
+#define GETINT(field) else if (!stricmp(stoken, #field)) skin->field = atoi(value);
+	GETINT(thrustfactor)
+	GETINT(accelstart)
+	GETINT(acceleration)
+	GETINT(contspeed)
+	GETINT(contangle)
+#undef GETINT
+
+#define GETSKINCOLOR(field) else if (!stricmp(stoken, #field)) skin->field = R_GetColorByName(value);
+	GETSKINCOLOR(prefcolor)
+	GETSKINCOLOR(prefoppositecolor)
+#undef GETSKINCOLOR
+	else if (!stricmp(stoken, "supercolor"))
+		skin->supercolor = R_GetSuperColorByName(value);
+
+#define GETFLOAT(field) else if (!stricmp(stoken, #field)) skin->field = FLOAT_TO_FIXED(atof(value));
+	GETFLOAT(jumpfactor)
+	GETFLOAT(highresscale)
+	GETFLOAT(shieldscale)
+	GETFLOAT(camerascale)
+#undef GETFLOAT
+
+#define GETFLAG(field) else if (!stricmp(stoken, #field)) { \
+	strupr(value); \
+	if (atoi(value) || value[0] == 'T' || value[0] == 'Y') \
+		skin->flags |= (SF_##field); \
+	else \
+		skin->flags &= ~(SF_##field); \
+}
+	// parameters for individual character flags
+	// these are uppercase so they can be concatenated with SF_
+	// 1, true, yes are all valid values
+	GETFLAG(SUPER)
+	GETFLAG(NOSUPERSPIN)
+	GETFLAG(NOSPINDASHDUST)
+	GETFLAG(HIRES)
+	GETFLAG(NOSKID)
+	GETFLAG(NOSPEEDADJUST)
+	GETFLAG(RUNONWATER)
+	GETFLAG(NOJUMPSPIN)
+	GETFLAG(NOJUMPDAMAGE)
+	GETFLAG(STOMPDAMAGE)
+	GETFLAG(MARIODAMAGE)
+	GETFLAG(MACHINE)
+	GETFLAG(DASHMODE)
+	GETFLAG(FASTEDGE)
+	GETFLAG(MULTIABILITY)
+	GETFLAG(NONIGHTSROTATION)
+#undef GETFLAG
+
+	else // let's check if it's a sound, otherwise error out
+	{
+		boolean found = false;
+		sfxenum_t i;
+		size_t stokenadjust;
+
+		// Remove the prefix. (We need to affect an adjusting variable so that we can print error messages if it's not actually a sound.)
+		if ((stoken[0] == 'D' || stoken[0] == 'd') && (stoken[1] == 'S' || stoken[1] == 's')) // DS*
+			stokenadjust = 2;
+		else // sfx_*
+			stokenadjust = 4;
+
+		// Remove the prefix. (We can affect this directly since we're not going to use it again.)
+		if ((value[0] == 'D' || value[0] == 'd') && (value[1] == 'S' || value[1] == 's')) // DS*
+			value += 2;
+		else // sfx_*
+			value += 4;
+
+		// copy name of sounds that are remapped
+		// for this skin
+		for (i = 0; i < sfx_skinsoundslot0; i++)
+		{
+			if (!S_sfx[i].name)
+				continue;
+			if (S_sfx[i].skinsound != -1
+				&& !stricmp(S_sfx[i].name,
+					stoken + stokenadjust))
+			{
+				skin->soundsid[S_sfx[i].skinsound] =
+					S_AddSoundFx(value, S_sfx[i].singularity, S_sfx[i].pitch, true);
+				found = true;
+			}
+		}
+		return found;
+	}
+	return true;
+}
+
+//
+// Find skin sprites, sounds & optional status bar face, & add them
+//
+void R_AddSkins(UINT16 wadnum)
+{
+	UINT16 lump, lastlump = 0;
+	char *buf;
+	char *buf2;
+	char *stoken;
+	char *value;
+	size_t size;
+	skin_t *skin;
+	boolean hudname, realname;
+
+	//
+	// search for all skin markers in pwad
+	//
+
+	while ((lump = W_CheckForSkinMarkerInPwad(wadnum, lastlump)) != INT16_MAX)
+	{
+		// advance by default
+		lastlump = lump + 1;
+
+		if (numskins >= MAXSKINS)
+		{
+			CONS_Debug(DBG_RENDER, "ignored skin (%d skins maximum)\n", MAXSKINS);
+			continue; // so we know how many skins couldn't be added
+		}
+		buf = W_CacheLumpNumPwad(wadnum, lump, PU_CACHE);
+		size = W_LumpLengthPwad(wadnum, lump);
+
+		// for strtok
+		buf2 = malloc(size+1);
+		if (!buf2)
+			I_Error("R_AddSkins: No more free memory\n");
+		M_Memcpy(buf2,buf,size);
+		buf2[size] = '\0';
+
+		// set defaults
+		skin = &skins[numskins];
+		Sk_SetDefaultValue(skin);
+		skin->wadnum = wadnum;
+		hudname = realname = false;
+		// parse
+		stoken = strtok (buf2, "\r\n= ");
+		while (stoken)
+		{
+			if ((stoken[0] == '/' && stoken[1] == '/')
+				|| (stoken[0] == '#'))// skip comments
+			{
+				stoken = strtok(NULL, "\r\n"); // skip end of line
+				goto next_token;              // find the real next token
+			}
+
+			value = strtok(NULL, "\r\n= ");
+
+			if (!value)
+				I_Error("R_AddSkins: syntax error in S_SKIN lump# %d(%s) in WAD %s\n", lump, W_CheckNameForNumPwad(wadnum,lump), wadfiles[wadnum]->filename);
+
+			// Some of these can't go in R_ProcessPatchableFields because they have side effects for future lines.
+			// Others can't go in there because we don't want them to be patchable.
+			if (!stricmp(stoken, "name"))
+			{
+				INT32 skinnum = R_SkinAvailable(value);
+				strlwr(value);
+				if (skinnum == -1)
+					STRBUFCPY(skin->name, value);
+				// the skin name must uniquely identify a single skin
+				// if the name is already used I make the name 'namex'
+				// using the default skin name's number set above
+				else
+				{
+					const size_t stringspace =
+						strlen(value) + sizeof (numskins) + 1;
+					char *value2 = Z_Malloc(stringspace, PU_STATIC, NULL);
+					snprintf(value2, stringspace,
+						"%s%d", value, numskins);
+					value2[stringspace - 1] = '\0';
+					if (R_SkinAvailable(value2) == -1)
+						// I'm lazy so if NEW name is already used I leave the 'skin x'
+						// default skin name set in Sk_SetDefaultValue
+						STRBUFCPY(skin->name, value2);
+					Z_Free(value2);
+				}
+
+				// copy to hudname and fullname as a default.
+				if (!realname)
+				{
+					STRBUFCPY(skin->realname, skin->name);
+					for (value = skin->realname; *value; value++)
+					{
+						if (*value == '_') *value = ' '; // turn _ into spaces.
+						else if (*value == '.') *value = '\x1E'; // turn . into katana dot.
+					}
+				}
+				if (!hudname)
+				{
+					HUDNAMEWRITE(skin->name);
+					strupr(skin->hudname);
+					SYMBOLCONVERT(skin->hudname)
+				}
+			}
+			else if (!stricmp(stoken, "realname"))
+			{ // Display name (eg. "Knuckles")
+				realname = true;
+				STRBUFCPY(skin->realname, value);
+				SYMBOLCONVERT(skin->realname)
+				if (!hudname)
+					HUDNAMEWRITE(skin->realname);
+			}
+			else if (!stricmp(stoken, "hudname"))
+			{ // Life icon name (eg. "K.T.E")
+				hudname = true;
+				HUDNAMEWRITE(value);
+				SYMBOLCONVERT(skin->hudname)
+				if (!realname)
+					STRBUFCPY(skin->realname, skin->hudname);
+			}
+			else if (!stricmp(stoken, "availability"))
+			{
+				skin->availability = atoi(value);
+				if (skin->availability >= MAXUNLOCKABLES)
+					skin->availability = 0;
+			}
+			else if (!R_ProcessPatchableFields(skin, stoken, value))
+				CONS_Debug(DBG_SETUP, "R_AddSkins: Unknown keyword '%s' in S_SKIN lump #%d (WAD %s)\n", stoken, lump, wadfiles[wadnum]->filename);
+
+next_token:
+			stoken = strtok(NULL, "\r\n= ");
+		}
+		free(buf2);
+
+		// Add sprites
+		R_LoadSkinSprites(wadnum, &lump, &lastlump, skin);
+		//ST_LoadFaceGraphics(numskins); -- nah let's do this elsewhere
+
+		R_FlushTranslationColormapCache();
+
+		if (!skin->availability) // Safe to print...
+			CONS_Printf(M_GetText("Added skin '%s'\n"), skin->name);
+#ifdef SKINVALUES
+		skin_cons_t[numskins].value = numskins;
+		skin_cons_t[numskins].strvalue = skin->name;
+#endif
+
+#ifdef HWRENDER
+		if (rendermode == render_opengl)
+			HWR_AddPlayerModel(numskins);
+#endif
+
+		numskins++;
+	}
+	return;
+}
+
+//
+// Patch skin sprites
+//
+void R_PatchSkins(UINT16 wadnum)
+{
+	UINT16 lump, lastlump = 0;
+	char *buf;
+	char *buf2;
+	char *stoken;
+	char *value;
+	size_t size;
+	skin_t *skin;
+	boolean noskincomplain, realname, hudname;
+
+	//
+	// search for all skin patch markers in pwad
+	//
+
+	while ((lump = W_CheckForPatchSkinMarkerInPwad(wadnum, lastlump)) != INT16_MAX)
+	{
+		INT32 skinnum = 0;
+
+		// advance by default
+		lastlump = lump + 1;
+
+		buf = W_CacheLumpNumPwad(wadnum, lump, PU_CACHE);
+		size = W_LumpLengthPwad(wadnum, lump);
+
+		// for strtok
+		buf2 = malloc(size+1);
+		if (!buf2)
+			I_Error("R_PatchSkins: No more free memory\n");
+		M_Memcpy(buf2,buf,size);
+		buf2[size] = '\0';
+
+		skin = NULL;
+		noskincomplain = realname = hudname = false;
+
+		/*
+		Parse. Has more phases than the parser in R_AddSkins because it needs to have the patching name first (no default skin name is acceptible for patching, unlike skin creation)
+		*/
+
+		stoken = strtok(buf2, "\r\n= ");
+		while (stoken)
+		{
+			if ((stoken[0] == '/' && stoken[1] == '/')
+				|| (stoken[0] == '#'))// skip comments
+			{
+				stoken = strtok(NULL, "\r\n"); // skip end of line
+				goto next_token;              // find the real next token
+			}
+
+			value = strtok(NULL, "\r\n= ");
+
+			if (!value)
+				I_Error("R_PatchSkins: syntax error in P_SKIN lump# %d(%s) in WAD %s\n", lump, W_CheckNameForNumPwad(wadnum,lump), wadfiles[wadnum]->filename);
+
+			if (!skin) // Get the name!
+			{
+				if (!stricmp(stoken, "name"))
+				{
+					strlwr(value);
+					skinnum = R_SkinAvailable(value);
+					if (skinnum != -1)
+						skin = &skins[skinnum];
+					else
+					{
+						CONS_Debug(DBG_SETUP, "R_PatchSkins: unknown skin name in P_SKIN lump# %d(%s) in WAD %s\n", lump, W_CheckNameForNumPwad(wadnum,lump), wadfiles[wadnum]->filename);
+						noskincomplain = true;
+					}
+				}
+			}
+			else // Get the properties!
+			{
+				// Some of these can't go in R_ProcessPatchableFields because they have side effects for future lines.
+				if (!stricmp(stoken, "realname"))
+				{ // Display name (eg. "Knuckles")
+					realname = true;
+					STRBUFCPY(skin->realname, value);
+					SYMBOLCONVERT(skin->realname)
+					if (!hudname)
+						HUDNAMEWRITE(skin->realname);
+				}
+				else if (!stricmp(stoken, "hudname"))
+				{ // Life icon name (eg. "K.T.E")
+					hudname = true;
+					HUDNAMEWRITE(value);
+					SYMBOLCONVERT(skin->hudname)
+					if (!realname)
+						STRBUFCPY(skin->realname, skin->hudname);
+				}
+				else if (!R_ProcessPatchableFields(skin, stoken, value))
+					CONS_Debug(DBG_SETUP, "R_PatchSkins: Unknown keyword '%s' in P_SKIN lump #%d (WAD %s)\n", stoken, lump, wadfiles[wadnum]->filename);
+			}
+
+			if (!skin)
+				break;
+
+next_token:
+			stoken = strtok(NULL, "\r\n= ");
+		}
+		free(buf2);
+
+		if (!skin) // Didn't include a name parameter? What a waste.
+		{
+			if (!noskincomplain)
+				CONS_Debug(DBG_SETUP, "R_PatchSkins: no skin name given in P_SKIN lump #%d (WAD %s)\n", lump, wadfiles[wadnum]->filename);
+			continue;
+		}
+
+		// Patch sprites
+		R_LoadSkinSprites(wadnum, &lump, &lastlump, skin);
+		//ST_LoadFaceGraphics(skinnum); -- nah let's do this elsewhere
+
+		R_FlushTranslationColormapCache();
+
+		if (!skin->availability) // Safe to print...
+			CONS_Printf(M_GetText("Patched skin '%s'\n"), skin->name);
+	}
+	return;
+}
+
+#undef HUDNAMEWRITE
+#undef SYMBOLCONVERT
diff --git a/src/r_skins.h b/src/r_skins.h
new file mode 100644
index 0000000000000000000000000000000000000000..96697b4220038c1bdbe491cbd4943b2b4127113b
--- /dev/null
+++ b/src/r_skins.h
@@ -0,0 +1,103 @@
+// SONIC ROBO BLAST 2
+//-----------------------------------------------------------------------------
+// Copyright (C) 1993-1996 by id Software, Inc.
+// Copyright (C) 1998-2000 by DooM Legacy Team.
+// Copyright (C) 1999-2020 by Sonic Team Junior.
+//
+// This program is free software distributed under the
+// terms of the GNU General Public License, version 2.
+// See the 'LICENSE' file for more details.
+//-----------------------------------------------------------------------------
+/// \file  r_skins.h
+/// \brief Skins stuff
+
+#ifndef __R_SKINS__
+#define __R_SKINS__
+
+#include "info.h"
+#include "sounds.h"
+#include "d_player.h" // skinflags
+#include "r_patch.h" // spriteinfo_t
+#include "r_defs.h" // spritedef_t
+
+/// Defaults
+#define SKINNAMESIZE 16
+// should be all lowercase!! S_SKIN processing does a strlwr
+#define DEFAULTSKIN "sonic"
+#define DEFAULTSKIN2 "tails" // secondary player
+#define DEFAULTNIGHTSSKIN 0
+
+/// The skin_t struct
+typedef struct
+{
+	char name[SKINNAMESIZE+1]; // INT16 descriptive name of the skin
+	UINT16 wadnum;
+	skinflags_t flags;
+
+	char realname[SKINNAMESIZE+1]; // Display name for level completion.
+	char hudname[SKINNAMESIZE+1]; // HUD name to display (officially exactly 5 characters long)
+
+	UINT8 ability; // ability definition
+	UINT8 ability2; // secondary ability definition
+	INT32 thokitem;
+	INT32 spinitem;
+	INT32 revitem;
+	INT32 followitem;
+	fixed_t actionspd;
+	fixed_t mindash;
+	fixed_t maxdash;
+
+	fixed_t normalspeed; // Normal ground
+	fixed_t runspeed; // Speed that you break into your run animation
+
+	UINT8 thrustfactor; // Thrust = thrustfactor * acceleration
+	UINT8 accelstart; // Acceleration if speed = 0
+	UINT8 acceleration; // Acceleration
+
+	fixed_t jumpfactor; // multiple of standard jump height
+
+	fixed_t radius; // Bounding box changes.
+	fixed_t height;
+	fixed_t spinheight;
+
+	fixed_t shieldscale; // no change to bounding box, but helps set the shield's sprite size
+	fixed_t camerascale;
+
+	// Definable color translation table
+	UINT8 starttranscolor;
+	UINT8 prefcolor;
+	UINT8 supercolor;
+	UINT8 prefoppositecolor; // if 0 use tables instead
+
+	fixed_t highresscale; // scale of highres, default is 0.5
+	UINT8 contspeed; // continue screen animation speed
+	UINT8 contangle; // initial angle on continue screen
+
+	// specific sounds per skin
+	sfxenum_t soundsid[NUMSKINSOUNDS]; // sound # in S_sfx table
+
+	// contains super versions too
+	spritedef_t sprites[NUMPLAYERSPRITES*2];
+	spriteinfo_t sprinfo[NUMPLAYERSPRITES*2];
+
+	UINT8 availability; // lock?
+} skin_t;
+
+/// Externs
+extern INT32 numskins;
+extern skin_t skins[MAXSKINS];
+
+/// Function prototypes
+void R_InitSkins(void);
+
+void SetPlayerSkin(INT32 playernum,const char *skinname);
+void SetPlayerSkinByNum(INT32 playernum,INT32 skinnum); // Tails 03-16-2002
+boolean R_SkinUsable(INT32 playernum, INT32 skinnum);
+UINT32 R_GetSkinAvailabilities(void);
+INT32 R_SkinAvailable(const char *name);
+void R_PatchSkins(UINT16 wadnum);
+void R_AddSkins(UINT16 wadnum);
+
+UINT8 P_GetSkinSprite2(skin_t *skin, UINT8 spr2, player_t *player);
+
+#endif //__R_SKINS__
diff --git a/src/r_things.c b/src/r_things.c
index 953825d0f3aaf3d2e38f8245d4b5ffafe3dd1ceb..fc0469f4cf369b7cbfd0f535bde717dafe92a796 100644
--- a/src/r_things.c
+++ b/src/r_things.c
@@ -30,11 +30,8 @@
 #include "p_tick.h"
 #include "p_local.h"
 #include "p_slopes.h"
-#include "dehacked.h" // get_number (for thok)
 #include "d_netfil.h" // blargh. for nameonly().
 #include "m_cheat.h" // objectplace
-#include "m_cond.h"
-#include "fastcmp.h"
 #ifdef HWRENDER
 #include "hardware/hw_md2.h"
 #include "hardware/hw_glob.h"
@@ -42,14 +39,6 @@
 #include "hardware/hw_drv.h"
 #endif
 
-#ifdef PC_DOS
-#include <stdio.h> // for snprintf
-int	snprintf(char *str, size_t n, const char *fmt, ...);
-//int	vsnprintf(char *str, size_t n, const char *fmt, va_list ap);
-#endif
-
-static void R_InitSkins(void);
-
 #define MINZ (FRACUNIT*4)
 #define BASEYCENTER (BASEVIDHEIGHT/2)
 
@@ -233,7 +222,7 @@ static void R_InstallSpriteLump(UINT16 wad,            // graphics patch
 //
 // Returns true if the sprite was succesfully added
 //
-static boolean R_AddSingleSpriteDef(const char *sprname, spritedef_t *spritedef, UINT16 wadnum, UINT16 startlump, UINT16 endlump)
+boolean R_AddSingleSpriteDef(const char *sprname, spritedef_t *spritedef, UINT16 wadnum, UINT16 startlump, UINT16 endlump)
 {
 	UINT16 l;
 	UINT8 frame;
@@ -245,6 +234,8 @@ static boolean R_AddSingleSpriteDef(const char *sprname, spritedef_t *spritedef,
 	memset(sprtemp,0xFF, sizeof (sprtemp));
 	maxframe = (size_t)-1;
 
+	spritename = sprname;
+
 	// are we 'patching' a sprite already loaded ?
 	// if so, it might patch only certain frames, not all
 	if (spritedef->numframes) // (then spriteframes is not null)
@@ -476,11 +467,10 @@ void R_AddSpriteDefs(UINT16 wadnum)
 	//
 	for (i = 0; i < numsprites; i++)
 	{
-		spritename = sprnames[i];
-		if (spritename[4] && wadnum >= (UINT16)spritename[4])
+		if (sprnames[i][4] && wadnum >= (UINT16)sprnames[i][4])
 			continue;
 
-		if (R_AddSingleSpriteDef(spritename, &sprites[i], wadnum, start, end))
+		if (R_AddSingleSpriteDef(sprnames[i], &sprites[i], wadnum, start, end))
 		{
 #ifdef HWRENDER
 			if (rendermode == render_opengl)
@@ -489,7 +479,7 @@ void R_AddSpriteDefs(UINT16 wadnum)
 			// if a new sprite was added (not just replaced)
 			addsprites++;
 #ifndef ZDEBUG
-			CONS_Debug(DBG_SETUP, "sprite %s set in pwad %d\n", spritename, wadnum);
+			CONS_Debug(DBG_SETUP, "sprite %s set in pwad %d\n", sprnames[i], wadnum);
 #endif
 		}
 	}
@@ -1040,10 +1030,8 @@ static void R_SplitSprite(vissprite_t *sprite)
 		if (!(sector->lightlist[i].caster->flags & FF_CUTSPRITES))
 			continue;
 
-#ifdef ESLOPE
 		if (sector->lightlist[i].slope)
 			testheight = P_GetZAt(sector->lightlist[i].slope, sprite->gx, sprite->gy);
-#endif
 
 		if (testheight >= sprite->gzt)
 			continue;
@@ -1331,9 +1319,9 @@ static void R_ProjectDropShadow(mobj_t *thing, vissprite_t *vis, fixed_t scale,
 	if (thing->subsector->sector->numlights)
 	{
 		INT32 lightnum;
-#ifdef ESLOPE // R_GetPlaneLight won't work on sloped lights!
 		light = thing->subsector->sector->numlights - 1;
 
+		// R_GetPlaneLight won't work on sloped lights!
 		for (lightnum = 1; lightnum < thing->subsector->sector->numlights; lightnum++) {
 			fixed_t h = thing->subsector->sector->lightlist[lightnum].slope ? P_GetZAt(thing->subsector->sector->lightlist[lightnum].slope, thing->x, thing->y)
 			            : thing->subsector->sector->lightlist[lightnum].height;
@@ -1342,9 +1330,7 @@ static void R_ProjectDropShadow(mobj_t *thing, vissprite_t *vis, fixed_t scale,
 				break;
 			}
 		}
-#else
-		light = R_GetPlaneLight(thing->subsector->sector, shadow->gzt, false);
-#endif
+		//light = R_GetPlaneLight(thing->subsector->sector, shadow->gzt, false);
 	}
 
 	if (thing->subsector->sector->numlights)
@@ -1740,9 +1726,9 @@ static void R_ProjectSprite(mobj_t *thing)
 	if (thing->subsector->sector->numlights)
 	{
 		INT32 lightnum;
-#ifdef ESLOPE // R_GetPlaneLight won't work on sloped lights!
 		light = thing->subsector->sector->numlights - 1;
 
+		// R_GetPlaneLight won't work on sloped lights!
 		for (lightnum = 1; lightnum < thing->subsector->sector->numlights; lightnum++) {
 			fixed_t h = thing->subsector->sector->lightlist[lightnum].slope ? P_GetZAt(thing->subsector->sector->lightlist[lightnum].slope, thing->x, thing->y)
 			            : thing->subsector->sector->lightlist[lightnum].height;
@@ -1751,9 +1737,7 @@ static void R_ProjectSprite(mobj_t *thing)
 				break;
 			}
 		}
-#else
-		light = R_GetPlaneLight(thing->subsector->sector, gzt, false);
-#endif
+		//light = R_GetPlaneLight(thing->subsector->sector, gzt, false);
 		lightnum = (*thing->subsector->sector->lightlist[light].lightlevel >> LIGHTSEGSHIFT);
 
 		if (lightnum < 0)
@@ -2403,13 +2387,12 @@ static void R_CreateDrawNodes(maskcount_t* mask, drawnode_t* head, boolean temps
 				if (rover->szt > r2->plane->low || rover->sz < r2->plane->high)
 					continue;
 
-#ifdef ESLOPE
 				// Effective height may be different for each comparison in the case of slopes
 				if (r2->plane->slope) {
 					planeobjectz = P_GetZAt(r2->plane->slope, rover->gx, rover->gy);
 					planecameraz = P_GetZAt(r2->plane->slope, viewx, viewy);
-				} else
-#endif
+				}
+				else
 					planeobjectz = planecameraz = r2->plane->height;
 
 				if (rover->mobjflags & MF_NOCLIPHEIGHT)
@@ -2468,20 +2451,18 @@ static void R_CreateDrawNodes(maskcount_t* mask, drawnode_t* head, boolean temps
 				if (scale <= rover->sortscale)
 					continue;
 
-#ifdef ESLOPE
 				if (*r2->ffloor->t_slope) {
 					topplaneobjectz = P_GetZAt(*r2->ffloor->t_slope, rover->gx, rover->gy);
 					topplanecameraz = P_GetZAt(*r2->ffloor->t_slope, viewx, viewy);
-				} else
-#endif
+				}
+				else
 					topplaneobjectz = topplanecameraz = *r2->ffloor->topheight;
 
-#ifdef ESLOPE
 				if (*r2->ffloor->b_slope) {
 					botplaneobjectz = P_GetZAt(*r2->ffloor->b_slope, rover->gx, rover->gy);
 					botplanecameraz = P_GetZAt(*r2->ffloor->b_slope, viewx, viewy);
-				} else
-#endif
+				}
+				else
 					botplaneobjectz = botplanecameraz = *r2->ffloor->bottomheight;
 
 				if ((topplanecameraz > viewz && botplanecameraz < viewz) ||
@@ -2964,795 +2945,3 @@ void R_DrawMasked(maskcount_t* masks, UINT8 nummasks)
 
 	free(heads);
 }
-
-// ==========================================================================
-//
-//                              SKINS CODE
-//
-// ==========================================================================
-
-INT32 numskins = 0;
-skin_t skins[MAXSKINS];
-// FIXTHIS: don't work because it must be inistilised before the config load
-//#define SKINVALUES
-#ifdef SKINVALUES
-CV_PossibleValue_t skin_cons_t[MAXSKINS+1];
-#endif
-
-//
-// P_GetSkinSprite2
-// For non-super players, tries each sprite2's immediate predecessor until it finds one with a number of frames or ends up at standing.
-// For super players, does the same as above - but tries the super equivalent for each sprite2 before the non-super version.
-//
-
-UINT8 P_GetSkinSprite2(skin_t *skin, UINT8 spr2, player_t *player)
-{
-	UINT8 super = 0, i = 0;
-
-	if (!skin)
-		return 0;
-
-	if ((playersprite_t)(spr2 & ~FF_SPR2SUPER) >= free_spr2)
-		return 0;
-
-	while (!skin->sprites[spr2].numframes
-		&& spr2 != SPR2_STND
-		&& ++i < 32) // recursion limiter
-	{
-		if (spr2 & FF_SPR2SUPER)
-		{
-			super = FF_SPR2SUPER;
-			spr2 &= ~FF_SPR2SUPER;
-			continue;
-		}
-
-		switch(spr2)
-		{
-		// Normal special cases.
-		case SPR2_JUMP:
-			spr2 = ((player
-					? player->charflags
-					: skin->flags)
-					& SF_NOJUMPSPIN) ? SPR2_SPNG : SPR2_ROLL;
-			break;
-		case SPR2_TIRE:
-			spr2 = ((player
-					? player->charability
-					: skin->ability)
-					== CA_SWIM) ? SPR2_SWIM : SPR2_FLY;
-			break;
-		// Use the handy list, that's what it's there for!
-		default:
-			spr2 = spr2defaults[spr2];
-			break;
-		}
-
-		spr2 |= super;
-	}
-
-	if (i >= 32) // probably an infinite loop...
-		return 0;
-
-	return spr2;
-}
-
-static void Sk_SetDefaultValue(skin_t *skin)
-{
-	INT32 i;
-	//
-	// set default skin values
-	//
-	memset(skin, 0, sizeof (skin_t));
-	snprintf(skin->name,
-		sizeof skin->name, "skin %u", (UINT32)(skin-skins));
-	skin->name[sizeof skin->name - 1] = '\0';
-	skin->wadnum = INT16_MAX;
-
-	skin->flags = 0;
-
-	strcpy(skin->realname, "Someone");
-	strcpy(skin->hudname, "???");
-
-	skin->starttranscolor = 96;
-	skin->prefcolor = SKINCOLOR_GREEN;
-	skin->supercolor = SKINCOLOR_SUPERGOLD1;
-	skin->prefoppositecolor = 0; // use tables
-
-	skin->normalspeed = 36<<FRACBITS;
-	skin->runspeed = 28<<FRACBITS;
-	skin->thrustfactor = 5;
-	skin->accelstart = 96;
-	skin->acceleration = 40;
-
-	skin->ability = CA_NONE;
-	skin->ability2 = CA2_SPINDASH;
-	skin->jumpfactor = FRACUNIT;
-	skin->actionspd = 30<<FRACBITS;
-	skin->mindash = 15<<FRACBITS;
-	skin->maxdash = 70<<FRACBITS;
-
-	skin->radius = mobjinfo[MT_PLAYER].radius;
-	skin->height = mobjinfo[MT_PLAYER].height;
-	skin->spinheight = FixedMul(skin->height, 2*FRACUNIT/3);
-
-	skin->shieldscale = FRACUNIT;
-	skin->camerascale = FRACUNIT;
-
-	skin->thokitem = -1;
-	skin->spinitem = -1;
-	skin->revitem = -1;
-	skin->followitem = 0;
-
-	skin->highresscale = FRACUNIT;
-	skin->contspeed = 17;
-	skin->contangle = 0;
-
-	skin->availability = 0;
-
-	for (i = 0; i < sfx_skinsoundslot0; i++)
-		if (S_sfx[i].skinsound != -1)
-			skin->soundsid[S_sfx[i].skinsound] = i;
-}
-
-//
-// Initialize the basic skins
-//
-void R_InitSkins(void)
-{
-#ifdef SKINVALUES
-	INT32 i;
-
-	for (i = 0; i <= MAXSKINS; i++)
-	{
-		skin_cons_t[i].value = 0;
-		skin_cons_t[i].strvalue = NULL;
-	}
-#endif
-
-	// no default skin!
-	numskins = 0;
-}
-
-UINT32 R_GetSkinAvailabilities(void)
-{
-	INT32 s;
-	UINT32 response = 0;
-
-	for (s = 0; s < MAXSKINS; s++)
-	{
-		if (skins[s].availability && unlockables[skins[s].availability - 1].unlocked)
-			response |= (1 << s);
-	}
-	return response;
-}
-
-// returns true if available in circumstances, otherwise nope
-// warning don't use with an invalid skinnum other than -1 which always returns true
-boolean R_SkinUsable(INT32 playernum, INT32 skinnum)
-{
-	return ((skinnum == -1) // Simplifies things elsewhere, since there's already plenty of checks for less-than-0...
-		|| (!skins[skinnum].availability)
-		|| (((netgame || multiplayer) && playernum != -1) ? (players[playernum].availabilities & (1 << skinnum)) : (unlockables[skins[skinnum].availability - 1].unlocked))
-		|| (modeattacking) // If you have someone else's run you might as well take a look
-		|| (Playing() && (R_SkinAvailable(mapheaderinfo[gamemap-1]->forcecharacter) == skinnum)) // Force 1.
-		|| (netgame && (cv_forceskin.value == skinnum)) // Force 2.
-		|| (metalrecording && skinnum == 5) // Force 3.
-		);
-}
-
-// returns true if the skin name is found (loaded from pwad)
-// warning return -1 if not found
-INT32 R_SkinAvailable(const char *name)
-{
-	INT32 i;
-
-	for (i = 0; i < numskins; i++)
-	{
-		// search in the skin list
-		if (stricmp(skins[i].name,name)==0)
-			return i;
-	}
-	return -1;
-}
-
-// network code calls this when a 'skin change' is received
-void SetPlayerSkin(INT32 playernum, const char *skinname)
-{
-	INT32 i = R_SkinAvailable(skinname);
-	player_t *player = &players[playernum];
-
-	if ((i != -1) && R_SkinUsable(playernum, i))
-	{
-		SetPlayerSkinByNum(playernum, i);
-		return;
-	}
-
-	if (P_IsLocalPlayer(player))
-		CONS_Alert(CONS_WARNING, M_GetText("Skin '%s' not found.\n"), skinname);
-	else if(server || IsPlayerAdmin(consoleplayer))
-		CONS_Alert(CONS_WARNING, M_GetText("Player %d (%s) skin '%s' not found\n"), playernum, player_names[playernum], skinname);
-
-	SetPlayerSkinByNum(playernum, 0);
-}
-
-// Same as SetPlayerSkin, but uses the skin #.
-// network code calls this when a 'skin change' is received
-void SetPlayerSkinByNum(INT32 playernum, INT32 skinnum)
-{
-	player_t *player = &players[playernum];
-	skin_t *skin = &skins[skinnum];
-	UINT8 newcolor = 0;
-
-	if (skinnum >= 0 && skinnum < numskins && R_SkinUsable(playernum, skinnum)) // Make sure it exists!
-	{
-		player->skin = skinnum;
-
-		player->camerascale = skin->camerascale;
-		player->shieldscale = skin->shieldscale;
-
-		player->charability = (UINT8)skin->ability;
-		player->charability2 = (UINT8)skin->ability2;
-
-		player->charflags = (UINT32)skin->flags;
-
-		player->thokitem = skin->thokitem < 0 ? (UINT32)mobjinfo[MT_PLAYER].painchance : (UINT32)skin->thokitem;
-		player->spinitem = skin->spinitem < 0 ? (UINT32)mobjinfo[MT_PLAYER].damage : (UINT32)skin->spinitem;
-		player->revitem = skin->revitem < 0 ? (mobjtype_t)mobjinfo[MT_PLAYER].raisestate : (UINT32)skin->revitem;
-		player->followitem = skin->followitem;
-
-		if (((player->powers[pw_shield] & SH_NOSTACK) == SH_PINK) && (player->revitem == MT_LHRT || player->spinitem == MT_LHRT || player->thokitem == MT_LHRT)) // Healers can't keep their buff.
-			player->powers[pw_shield] &= SH_STACK;
-
-		player->actionspd = skin->actionspd;
-		player->mindash = skin->mindash;
-		player->maxdash = skin->maxdash;
-
-		player->normalspeed = skin->normalspeed;
-		player->runspeed = skin->runspeed;
-		player->thrustfactor = skin->thrustfactor;
-		player->accelstart = skin->accelstart;
-		player->acceleration = skin->acceleration;
-
-		player->jumpfactor = skin->jumpfactor;
-
-		player->height = skin->height;
-		player->spinheight = skin->spinheight;
-
-		if (!(cv_debug || devparm) && !(netgame || multiplayer || demoplayback))
-		{
-			if (playernum == consoleplayer)
-				CV_StealthSetValue(&cv_playercolor, skin->prefcolor);
-			else if (playernum == secondarydisplayplayer)
-				CV_StealthSetValue(&cv_playercolor2, skin->prefcolor);
-			player->skincolor = newcolor = skin->prefcolor;
-		}
-
-		if (player->followmobj)
-		{
-			P_RemoveMobj(player->followmobj);
-			P_SetTarget(&player->followmobj, NULL);
-		}
-
-		if (player->mo)
-		{
-			fixed_t radius = FixedMul(skin->radius, player->mo->scale);
-			if ((player->powers[pw_carry] == CR_NIGHTSMODE) && (skin->sprites[SPR2_NFLY].numframes == 0)) // If you don't have a sprite for flying horizontally, use the default NiGHTS skin.
-			{
-				skin = &skins[DEFAULTNIGHTSSKIN];
-				player->followitem = skin->followitem;
-				if (!(cv_debug || devparm) && !(netgame || multiplayer || demoplayback))
-					newcolor = skin->prefcolor; // will be updated in thinker to flashing
-			}
-			player->mo->skin = skin;
-			if (newcolor)
-				player->mo->color = newcolor;
-			P_SetScale(player->mo, player->mo->scale);
-			player->mo->radius = radius;
-
-			P_SetPlayerMobjState(player->mo, player->mo->state-states); // Prevent visual errors when switching between skins with differing number of frames
-		}
-		return;
-	}
-
-	if (P_IsLocalPlayer(player))
-		CONS_Alert(CONS_WARNING, M_GetText("Requested skin %d not found\n"), skinnum);
-	else if(server || IsPlayerAdmin(consoleplayer))
-		CONS_Alert(CONS_WARNING, "Player %d (%s) skin %d not found\n", playernum, player_names[playernum], skinnum);
-	SetPlayerSkinByNum(playernum, 0); // not found put the sonic skin
-}
-
-//
-// Add skins from a pwad, each skin preceded by 'S_SKIN' marker
-//
-
-// Does the same is in w_wad, but check only for
-// the first 6 characters (this is so we can have S_SKIN1, S_SKIN2..
-// for wad editors that don't like multiple resources of the same name)
-//
-static UINT16 W_CheckForSkinMarkerInPwad(UINT16 wadid, UINT16 startlump)
-{
-	UINT16 i;
-	const char *S_SKIN = "S_SKIN";
-	lumpinfo_t *lump_p;
-
-	// scan forward, start at <startlump>
-	if (startlump < wadfiles[wadid]->numlumps)
-	{
-		lump_p = wadfiles[wadid]->lumpinfo + startlump;
-		for (i = startlump; i < wadfiles[wadid]->numlumps; i++, lump_p++)
-			if (memcmp(lump_p->name,S_SKIN,6)==0)
-				return i;
-	}
-	return INT16_MAX; // not found
-}
-
-#define HUDNAMEWRITE(value) STRBUFCPY(skin->hudname, value)
-
-// turn _ into spaces and . into katana dot
-#define SYMBOLCONVERT(name) for (value = name; *value; value++)\
-					{\
-						if (*value == '_') *value = ' ';\
-						else if (*value == '.') *value = '\x1E';\
-					}
-
-//
-// Patch skins from a pwad, each skin preceded by 'P_SKIN' marker
-//
-
-// Does the same is in w_wad, but check only for
-// the first 6 characters (this is so we can have P_SKIN1, P_SKIN2..
-// for wad editors that don't like multiple resources of the same name)
-//
-static UINT16 W_CheckForPatchSkinMarkerInPwad(UINT16 wadid, UINT16 startlump)
-{
-	UINT16 i;
-	const char *P_SKIN = "P_SKIN";
-	lumpinfo_t *lump_p;
-
-	// scan forward, start at <startlump>
-	if (startlump < wadfiles[wadid]->numlumps)
-	{
-		lump_p = wadfiles[wadid]->lumpinfo + startlump;
-		for (i = startlump; i < wadfiles[wadid]->numlumps; i++, lump_p++)
-			if (memcmp(lump_p->name,P_SKIN,6)==0)
-				return i;
-	}
-	return INT16_MAX; // not found
-}
-
-static void R_LoadSkinSprites(UINT16 wadnum, UINT16 *lump, UINT16 *lastlump, skin_t *skin)
-{
-	UINT16 newlastlump;
-	UINT8 sprite2;
-
-	*lump += 1; // start after S_SKIN
-	*lastlump = W_CheckNumForNamePwad("S_END",wadnum,*lump); // stop at S_END
-
-	// old wadding practices die hard -- stop at S_SKIN (or P_SKIN) or S_START if they come before S_END.
-	newlastlump = W_CheckForSkinMarkerInPwad(wadnum,*lump);
-	if (newlastlump < *lastlump) *lastlump = newlastlump;
-	newlastlump = W_CheckForPatchSkinMarkerInPwad(wadnum,*lump);
-	if (newlastlump < *lastlump) *lastlump = newlastlump;
-	newlastlump = W_CheckNumForNamePwad("S_START",wadnum,*lump);
-	if (newlastlump < *lastlump) *lastlump = newlastlump;
-
-	// ...and let's handle super, too
-	newlastlump = W_CheckNumForNamePwad("S_SUPER",wadnum,*lump);
-	if (newlastlump < *lastlump)
-	{
-		newlastlump++;
-		// load all sprite sets we are aware of... for super!
-		for (sprite2 = 0; sprite2 < free_spr2; sprite2++)
-			R_AddSingleSpriteDef((spritename = spr2names[sprite2]), &skin->sprites[FF_SPR2SUPER|sprite2], wadnum, newlastlump, *lastlump);
-
-		newlastlump--;
-		*lastlump = newlastlump; // okay, make the normal sprite set loading end there
-	}
-
-	// load all sprite sets we are aware of... for normal stuff.
-	for (sprite2 = 0; sprite2 < free_spr2; sprite2++)
-		R_AddSingleSpriteDef((spritename = spr2names[sprite2]), &skin->sprites[sprite2], wadnum, *lump, *lastlump);
-
-	if (skin->sprites[0].numframes == 0)
-		I_Error("R_LoadSkinSprites: no frames found for sprite SPR2_%s\n", spr2names[0]);
-}
-
-// returns whether found appropriate property
-static boolean R_ProcessPatchableFields(skin_t *skin, char *stoken, char *value)
-{
-	// custom translation table
-	if (!stricmp(stoken, "startcolor"))
-		skin->starttranscolor = atoi(value);
-
-#define FULLPROCESS(field) else if (!stricmp(stoken, #field)) skin->field = get_number(value);
-	// character type identification
-	FULLPROCESS(flags)
-	FULLPROCESS(ability)
-	FULLPROCESS(ability2)
-
-	FULLPROCESS(thokitem)
-	FULLPROCESS(spinitem)
-	FULLPROCESS(revitem)
-	FULLPROCESS(followitem)
-#undef FULLPROCESS
-
-#define GETFRACBITS(field) else if (!stricmp(stoken, #field)) skin->field = atoi(value)<<FRACBITS;
-	GETFRACBITS(normalspeed)
-	GETFRACBITS(runspeed)
-
-	GETFRACBITS(mindash)
-	GETFRACBITS(maxdash)
-	GETFRACBITS(actionspd)
-
-	GETFRACBITS(radius)
-	GETFRACBITS(height)
-	GETFRACBITS(spinheight)
-#undef GETFRACBITS
-
-#define GETINT(field) else if (!stricmp(stoken, #field)) skin->field = atoi(value);
-	GETINT(thrustfactor)
-	GETINT(accelstart)
-	GETINT(acceleration)
-	GETINT(contspeed)
-	GETINT(contangle)
-#undef GETINT
-
-#define GETSKINCOLOR(field) else if (!stricmp(stoken, #field)) skin->field = R_GetColorByName(value);
-	GETSKINCOLOR(prefcolor)
-	GETSKINCOLOR(prefoppositecolor)
-#undef GETSKINCOLOR
-	else if (!stricmp(stoken, "supercolor"))
-		skin->supercolor = R_GetSuperColorByName(value);
-
-#define GETFLOAT(field) else if (!stricmp(stoken, #field)) skin->field = FLOAT_TO_FIXED(atof(value));
-	GETFLOAT(jumpfactor)
-	GETFLOAT(highresscale)
-	GETFLOAT(shieldscale)
-	GETFLOAT(camerascale)
-#undef GETFLOAT
-
-#define GETFLAG(field) else if (!stricmp(stoken, #field)) { \
-	strupr(value); \
-	if (atoi(value) || value[0] == 'T' || value[0] == 'Y') \
-		skin->flags |= (SF_##field); \
-	else \
-		skin->flags &= ~(SF_##field); \
-}
-	// parameters for individual character flags
-	// these are uppercase so they can be concatenated with SF_
-	// 1, true, yes are all valid values
-	GETFLAG(SUPER)
-	GETFLAG(NOSUPERSPIN)
-	GETFLAG(NOSPINDASHDUST)
-	GETFLAG(HIRES)
-	GETFLAG(NOSKID)
-	GETFLAG(NOSPEEDADJUST)
-	GETFLAG(RUNONWATER)
-	GETFLAG(NOJUMPSPIN)
-	GETFLAG(NOJUMPDAMAGE)
-	GETFLAG(STOMPDAMAGE)
-	GETFLAG(MARIODAMAGE)
-	GETFLAG(MACHINE)
-	GETFLAG(DASHMODE)
-	GETFLAG(FASTEDGE)
-	GETFLAG(MULTIABILITY)
-	GETFLAG(NONIGHTSROTATION)
-#undef GETFLAG
-
-	else // let's check if it's a sound, otherwise error out
-	{
-		boolean found = false;
-		sfxenum_t i;
-		size_t stokenadjust;
-
-		// Remove the prefix. (We need to affect an adjusting variable so that we can print error messages if it's not actually a sound.)
-		if ((stoken[0] == 'D' || stoken[0] == 'd') && (stoken[1] == 'S' || stoken[1] == 's')) // DS*
-			stokenadjust = 2;
-		else // sfx_*
-			stokenadjust = 4;
-
-		// Remove the prefix. (We can affect this directly since we're not going to use it again.)
-		if ((value[0] == 'D' || value[0] == 'd') && (value[1] == 'S' || value[1] == 's')) // DS*
-			value += 2;
-		else // sfx_*
-			value += 4;
-
-		// copy name of sounds that are remapped
-		// for this skin
-		for (i = 0; i < sfx_skinsoundslot0; i++)
-		{
-			if (!S_sfx[i].name)
-				continue;
-			if (S_sfx[i].skinsound != -1
-				&& !stricmp(S_sfx[i].name,
-					stoken + stokenadjust))
-			{
-				skin->soundsid[S_sfx[i].skinsound] =
-					S_AddSoundFx(value, S_sfx[i].singularity, S_sfx[i].pitch, true);
-				found = true;
-			}
-		}
-		return found;
-	}
-	return true;
-}
-
-//
-// Find skin sprites, sounds & optional status bar face, & add them
-//
-void R_AddSkins(UINT16 wadnum)
-{
-	UINT16 lump, lastlump = 0;
-	char *buf;
-	char *buf2;
-	char *stoken;
-	char *value;
-	size_t size;
-	skin_t *skin;
-	boolean hudname, realname;
-
-	//
-	// search for all skin markers in pwad
-	//
-
-	while ((lump = W_CheckForSkinMarkerInPwad(wadnum, lastlump)) != INT16_MAX)
-	{
-		// advance by default
-		lastlump = lump + 1;
-
-		if (numskins >= MAXSKINS)
-		{
-			CONS_Debug(DBG_RENDER, "ignored skin (%d skins maximum)\n", MAXSKINS);
-			continue; // so we know how many skins couldn't be added
-		}
-		buf = W_CacheLumpNumPwad(wadnum, lump, PU_CACHE);
-		size = W_LumpLengthPwad(wadnum, lump);
-
-		// for strtok
-		buf2 = malloc(size+1);
-		if (!buf2)
-			I_Error("R_AddSkins: No more free memory\n");
-		M_Memcpy(buf2,buf,size);
-		buf2[size] = '\0';
-
-		// set defaults
-		skin = &skins[numskins];
-		Sk_SetDefaultValue(skin);
-		skin->wadnum = wadnum;
-		hudname = realname = false;
-		// parse
-		stoken = strtok (buf2, "\r\n= ");
-		while (stoken)
-		{
-			if ((stoken[0] == '/' && stoken[1] == '/')
-				|| (stoken[0] == '#'))// skip comments
-			{
-				stoken = strtok(NULL, "\r\n"); // skip end of line
-				goto next_token;              // find the real next token
-			}
-
-			value = strtok(NULL, "\r\n= ");
-
-			if (!value)
-				I_Error("R_AddSkins: syntax error in S_SKIN lump# %d(%s) in WAD %s\n", lump, W_CheckNameForNumPwad(wadnum,lump), wadfiles[wadnum]->filename);
-
-			// Some of these can't go in R_ProcessPatchableFields because they have side effects for future lines.
-			// Others can't go in there because we don't want them to be patchable.
-			if (!stricmp(stoken, "name"))
-			{
-				INT32 skinnum = R_SkinAvailable(value);
-				strlwr(value);
-				if (skinnum == -1)
-					STRBUFCPY(skin->name, value);
-				// the skin name must uniquely identify a single skin
-				// if the name is already used I make the name 'namex'
-				// using the default skin name's number set above
-				else
-				{
-					const size_t stringspace =
-						strlen(value) + sizeof (numskins) + 1;
-					char *value2 = Z_Malloc(stringspace, PU_STATIC, NULL);
-					snprintf(value2, stringspace,
-						"%s%d", value, numskins);
-					value2[stringspace - 1] = '\0';
-					if (R_SkinAvailable(value2) == -1)
-						// I'm lazy so if NEW name is already used I leave the 'skin x'
-						// default skin name set in Sk_SetDefaultValue
-						STRBUFCPY(skin->name, value2);
-					Z_Free(value2);
-				}
-
-				// copy to hudname and fullname as a default.
-				if (!realname)
-				{
-					STRBUFCPY(skin->realname, skin->name);
-					for (value = skin->realname; *value; value++)
-					{
-						if (*value == '_') *value = ' '; // turn _ into spaces.
-						else if (*value == '.') *value = '\x1E'; // turn . into katana dot.
-					}
-				}
-				if (!hudname)
-				{
-					HUDNAMEWRITE(skin->name);
-					strupr(skin->hudname);
-					SYMBOLCONVERT(skin->hudname)
-				}
-			}
-			else if (!stricmp(stoken, "realname"))
-			{ // Display name (eg. "Knuckles")
-				realname = true;
-				STRBUFCPY(skin->realname, value);
-				SYMBOLCONVERT(skin->realname)
-				if (!hudname)
-					HUDNAMEWRITE(skin->realname);
-			}
-			else if (!stricmp(stoken, "hudname"))
-			{ // Life icon name (eg. "K.T.E")
-				hudname = true;
-				HUDNAMEWRITE(value);
-				SYMBOLCONVERT(skin->hudname)
-				if (!realname)
-					STRBUFCPY(skin->realname, skin->hudname);
-			}
-			else if (!stricmp(stoken, "availability"))
-			{
-				skin->availability = atoi(value);
-				if (skin->availability >= MAXUNLOCKABLES)
-					skin->availability = 0;
-			}
-			else if (!R_ProcessPatchableFields(skin, stoken, value))
-				CONS_Debug(DBG_SETUP, "R_AddSkins: Unknown keyword '%s' in S_SKIN lump #%d (WAD %s)\n", stoken, lump, wadfiles[wadnum]->filename);
-
-next_token:
-			stoken = strtok(NULL, "\r\n= ");
-		}
-		free(buf2);
-
-		// Add sprites
-		R_LoadSkinSprites(wadnum, &lump, &lastlump, skin);
-		//ST_LoadFaceGraphics(numskins); -- nah let's do this elsewhere
-
-		R_FlushTranslationColormapCache();
-
-		if (!skin->availability) // Safe to print...
-			CONS_Printf(M_GetText("Added skin '%s'\n"), skin->name);
-#ifdef SKINVALUES
-		skin_cons_t[numskins].value = numskins;
-		skin_cons_t[numskins].strvalue = skin->name;
-#endif
-
-#ifdef HWRENDER
-		if (rendermode == render_opengl)
-			HWR_AddPlayerModel(numskins);
-#endif
-
-		numskins++;
-	}
-	return;
-}
-
-//
-// Patch skin sprites
-//
-void R_PatchSkins(UINT16 wadnum)
-{
-	UINT16 lump, lastlump = 0;
-	char *buf;
-	char *buf2;
-	char *stoken;
-	char *value;
-	size_t size;
-	skin_t *skin;
-	boolean noskincomplain, realname, hudname;
-
-	//
-	// search for all skin patch markers in pwad
-	//
-
-	while ((lump = W_CheckForPatchSkinMarkerInPwad(wadnum, lastlump)) != INT16_MAX)
-	{
-		INT32 skinnum = 0;
-
-		// advance by default
-		lastlump = lump + 1;
-
-		buf = W_CacheLumpNumPwad(wadnum, lump, PU_CACHE);
-		size = W_LumpLengthPwad(wadnum, lump);
-
-		// for strtok
-		buf2 = malloc(size+1);
-		if (!buf2)
-			I_Error("R_PatchSkins: No more free memory\n");
-		M_Memcpy(buf2,buf,size);
-		buf2[size] = '\0';
-
-		skin = NULL;
-		noskincomplain = realname = hudname = false;
-
-		/*
-		Parse. Has more phases than the parser in R_AddSkins because it needs to have the patching name first (no default skin name is acceptible for patching, unlike skin creation)
-		*/
-
-		stoken = strtok(buf2, "\r\n= ");
-		while (stoken)
-		{
-			if ((stoken[0] == '/' && stoken[1] == '/')
-				|| (stoken[0] == '#'))// skip comments
-			{
-				stoken = strtok(NULL, "\r\n"); // skip end of line
-				goto next_token;              // find the real next token
-			}
-
-			value = strtok(NULL, "\r\n= ");
-
-			if (!value)
-				I_Error("R_PatchSkins: syntax error in P_SKIN lump# %d(%s) in WAD %s\n", lump, W_CheckNameForNumPwad(wadnum,lump), wadfiles[wadnum]->filename);
-
-			if (!skin) // Get the name!
-			{
-				if (!stricmp(stoken, "name"))
-				{
-					strlwr(value);
-					skinnum = R_SkinAvailable(value);
-					if (skinnum != -1)
-						skin = &skins[skinnum];
-					else
-					{
-						CONS_Debug(DBG_SETUP, "R_PatchSkins: unknown skin name in P_SKIN lump# %d(%s) in WAD %s\n", lump, W_CheckNameForNumPwad(wadnum,lump), wadfiles[wadnum]->filename);
-						noskincomplain = true;
-					}
-				}
-			}
-			else // Get the properties!
-			{
-				// Some of these can't go in R_ProcessPatchableFields because they have side effects for future lines.
-				if (!stricmp(stoken, "realname"))
-				{ // Display name (eg. "Knuckles")
-					realname = true;
-					STRBUFCPY(skin->realname, value);
-					SYMBOLCONVERT(skin->realname)
-					if (!hudname)
-						HUDNAMEWRITE(skin->realname);
-				}
-				else if (!stricmp(stoken, "hudname"))
-				{ // Life icon name (eg. "K.T.E")
-					hudname = true;
-					HUDNAMEWRITE(value);
-					SYMBOLCONVERT(skin->hudname)
-					if (!realname)
-						STRBUFCPY(skin->realname, skin->hudname);
-				}
-				else if (!R_ProcessPatchableFields(skin, stoken, value))
-					CONS_Debug(DBG_SETUP, "R_PatchSkins: Unknown keyword '%s' in P_SKIN lump #%d (WAD %s)\n", stoken, lump, wadfiles[wadnum]->filename);
-			}
-
-			if (!skin)
-				break;
-
-next_token:
-			stoken = strtok(NULL, "\r\n= ");
-		}
-		free(buf2);
-
-		if (!skin) // Didn't include a name parameter? What a waste.
-		{
-			if (!noskincomplain)
-				CONS_Debug(DBG_SETUP, "R_PatchSkins: no skin name given in P_SKIN lump #%d (WAD %s)\n", lump, wadfiles[wadnum]->filename);
-			continue;
-		}
-
-		// Patch sprites
-		R_LoadSkinSprites(wadnum, &lump, &lastlump, skin);
-		//ST_LoadFaceGraphics(skinnum); -- nah let's do this elsewhere
-
-		R_FlushTranslationColormapCache();
-
-		if (!skin->availability) // Safe to print...
-			CONS_Printf(M_GetText("Patched skin '%s'\n"), skin->name);
-	}
-	return;
-}
-
-#undef HUDNAMEWRITE
-#undef SYMBOLCONVERT
diff --git a/src/r_things.h b/src/r_things.h
index bd6271b60eaa2333662ddd0582f3677b7466145a..05d6fb27b7728e7f3a1103af3956468120a8ae9c 100644
--- a/src/r_things.h
+++ b/src/r_things.h
@@ -14,26 +14,27 @@
 #ifndef __R_THINGS__
 #define __R_THINGS__
 
-#include "sounds.h"
 #include "r_plane.h"
 #include "r_patch.h"
 #include "r_portal.h"
 #include "r_defs.h"
+#include "r_skins.h"
 
-// number of sprite lumps for spritewidth,offset,topoffset lookup tables
-// Fab: this is a hack : should allocate the lookup tables per sprite
-#define MAXVISSPRITES 2048 // added 2-2-98 was 128
-
-#define VISSPRITECHUNKBITS 6	// 2^6 = 64 sprites per chunk
-#define VISSPRITESPERCHUNK (1 << VISSPRITECHUNKBITS)
-#define VISSPRITEINDEXMASK (VISSPRITESPERCHUNK - 1)
+// --------------
+// SPRITE LOADING
+// --------------
 
 #define FEETADJUST (4<<FRACBITS) // R_AddSingleSpriteDef
 
-// Constant arrays used for psprite clipping
-//  and initializing clipping.
-extern INT16 negonearray[MAXVIDWIDTH];
-extern INT16 screenheightarray[MAXVIDWIDTH];
+boolean R_AddSingleSpriteDef(const char *sprname, spritedef_t *spritedef, UINT16 wadnum, UINT16 startlump, UINT16 endlump);
+
+//faB: find sprites in wadfile, replace existing, add new ones
+//     (only sprites from namelist are added or replaced)
+void R_AddSpriteDefs(UINT16 wadnum);
+
+// ---------------------
+// MASKED COLUMN DRAWING
+// ---------------------
 
 // vars for R_DrawMaskedColumn
 extern INT16 *mfloorclip;
@@ -47,9 +48,14 @@ extern fixed_t windowbottom;
 void R_DrawMaskedColumn(column_t *column);
 void R_DrawFlippedMaskedColumn(column_t *column, INT32 texheight);
 
-//faB: find sprites in wadfile, replace existing, add new ones
-//     (only sprites from namelist are added or replaced)
-void R_AddSpriteDefs(UINT16 wadnum);
+// ----------------
+// SPRITE RENDERING
+// ----------------
+
+// Constant arrays used for psprite clipping
+//  and initializing clipping.
+extern INT16 negonearray[MAXVIDWIDTH];
+extern INT16 screenheightarray[MAXVIDWIDTH];
 
 fixed_t R_GetShadowZ(mobj_t *thing, pslope_t **shadowslope);
 
@@ -68,6 +74,9 @@ boolean R_ThingVisibleWithinDist (mobj_t *thing,
 boolean R_PrecipThingVisible (precipmobj_t *precipthing,
 		fixed_t precip_draw_dist);
 
+// --------------
+// MASKED DRAWING
+// --------------
 /** Used to count the amount of masked elements
  * per portal to later group them in separate
  * drawnode lists.
@@ -82,73 +91,18 @@ typedef struct
 
 void R_DrawMasked(maskcount_t* masks, UINT8 nummasks);
 
-// -----------
-// SKINS STUFF
-// -----------
-#define SKINNAMESIZE 16
-// should be all lowercase!! S_SKIN processing does a strlwr
-#define DEFAULTSKIN "sonic"
-#define DEFAULTSKIN2 "tails" // secondary player
-#define DEFAULTNIGHTSSKIN 0
+// ----------
+// VISSPRITES
+// ----------
+
+// number of sprite lumps for spritewidth,offset,topoffset lookup tables
+// Fab: this is a hack : should allocate the lookup tables per sprite
+#define MAXVISSPRITES 2048 // added 2-2-98 was 128
+
+#define VISSPRITECHUNKBITS 6	// 2^6 = 64 sprites per chunk
+#define VISSPRITESPERCHUNK (1 << VISSPRITECHUNKBITS)
+#define VISSPRITEINDEXMASK (VISSPRITESPERCHUNK - 1)
 
-typedef struct
-{
-	char name[SKINNAMESIZE+1]; // INT16 descriptive name of the skin
-	UINT16 wadnum;
-	skinflags_t flags;
-
-	char realname[SKINNAMESIZE+1]; // Display name for level completion.
-	char hudname[SKINNAMESIZE+1]; // HUD name to display (officially exactly 5 characters long)
-
-	UINT8 ability; // ability definition
-	UINT8 ability2; // secondary ability definition
-	INT32 thokitem;
-	INT32 spinitem;
-	INT32 revitem;
-	INT32 followitem;
-	fixed_t actionspd;
-	fixed_t mindash;
-	fixed_t maxdash;
-
-	fixed_t normalspeed; // Normal ground
-	fixed_t runspeed; // Speed that you break into your run animation
-
-	UINT8 thrustfactor; // Thrust = thrustfactor * acceleration
-	UINT8 accelstart; // Acceleration if speed = 0
-	UINT8 acceleration; // Acceleration
-
-	fixed_t jumpfactor; // multiple of standard jump height
-
-	fixed_t radius; // Bounding box changes.
-	fixed_t height;
-	fixed_t spinheight;
-
-	fixed_t shieldscale; // no change to bounding box, but helps set the shield's sprite size
-	fixed_t camerascale;
-
-	// Definable color translation table
-	UINT8 starttranscolor;
-	UINT8 prefcolor;
-	UINT8 supercolor;
-	UINT8 prefoppositecolor; // if 0 use tables instead
-
-	fixed_t highresscale; // scale of highres, default is 0.5
-	UINT8 contspeed; // continue screen animation speed
-	UINT8 contangle; // initial angle on continue screen
-
-	// specific sounds per skin
-	sfxenum_t soundsid[NUMSKINSOUNDS]; // sound # in S_sfx table
-
-	// contains super versions too
-	spritedef_t sprites[NUMPLAYERSPRITES*2];
-	spriteinfo_t sprinfo[NUMPLAYERSPRITES*2];
-
-	UINT8 availability; // lock?
-} skin_t;
-
-// -----------
-// NOT SKINS STUFF !
-// -----------
 typedef enum
 {
 	// actual cuts
@@ -227,6 +181,12 @@ typedef struct vissprite_s
 	INT32 dispoffset; // copy of info->dispoffset, affects ordering but not drawing
 } vissprite_t;
 
+extern UINT32 visspritecount;
+
+// ----------
+// DRAW NODES
+// ----------
+
 // A drawnode is something that points to a 3D floor, 3D side, or masked
 // middle texture. This is used for sorting with sprites.
 typedef struct drawnode_s
@@ -241,23 +201,11 @@ typedef struct drawnode_s
 	struct drawnode_s *prev;
 } drawnode_t;
 
-extern INT32 numskins;
-extern skin_t skins[MAXSKINS];
-extern UINT32 visspritecount;
-
-void SetPlayerSkin(INT32 playernum,const char *skinname);
-void SetPlayerSkinByNum(INT32 playernum,INT32 skinnum); // Tails 03-16-2002
-boolean R_SkinUsable(INT32 playernum, INT32 skinnum);
-UINT32 R_GetSkinAvailabilities(void);
-INT32 R_SkinAvailable(const char *name);
-void R_PatchSkins(UINT16 wadnum);
-void R_AddSkins(UINT16 wadnum);
-
-UINT8 P_GetSkinSprite2(skin_t *skin, UINT8 spr2, player_t *player);
-
 void R_InitDrawNodes(void);
 
-char *GetPlayerFacePic(INT32 skinnum);
+// -----------------------
+// SPRITE FRAME CHARACTERS
+// -----------------------
 
 // Functions to go from sprite character ID to frame number
 // for 2.1 compatibility this still uses the old 'A' + frame code
diff --git a/src/s_sound.c b/src/s_sound.c
index 8193fdb9b948a7fe0b7aa9fedb53e9b77f0cd516..0cc40a9cef5226b0b6ec275d71dac5a29823637f 100644
--- a/src/s_sound.c
+++ b/src/s_sound.c
@@ -27,7 +27,7 @@ extern INT32 msg_id;
 #include "g_game.h"
 #include "m_argv.h"
 #include "r_main.h" // R_PointToAngle2() used to calc stereo sep.
-#include "r_things.h" // for skins
+#include "r_skins.h" // for skins
 #include "i_system.h"
 #include "i_sound.h"
 #include "s_sound.h"
@@ -40,7 +40,7 @@ extern INT32 msg_id;
 #include "m_misc.h" // for tunes command
 #include "m_cond.h" // for conditionsets
 
-#if defined(HAVE_BLUA) && defined(HAVE_LUA_MUSICPLUS)
+#ifdef HAVE_LUA_MUSICPLUS
 #include "lua_hook.h" // MusicChange hook
 #endif
 
@@ -2045,7 +2045,7 @@ static musicstack_t *S_GetMusicStackEntry(UINT16 status, boolean fromfirst, INT1
 
 		if (!status || mst->status == status)
 		{
-			if (P_EvaluateMusicStatus(mst->status))
+			if (P_EvaluateMusicStatus(mst->status, mst->musname))
 			{
 				if (!S_MusicExists(mst->musname, !midi_disabled, !digital_disabled)) // paranoia
 					S_RemoveMusicStackEntry(mst); // then continue
@@ -2314,7 +2314,7 @@ void S_ChangeMusicEx(const char *mmusic, UINT16 mflags, boolean looping, UINT32
 		return;
 
 	strncpy(newmusic, mmusic, 7);
-#if defined(HAVE_BLUA) && defined(HAVE_LUA_MUSICPLUS)
+#ifdef HAVE_LUA_MUSICPLUS
 	if(LUAh_MusicChange(music_name, newmusic, &mflags, &looping, &position, &prefadems, &fadeinms))
 		return;
 #endif
diff --git a/src/screen.c b/src/screen.c
index 7ebe34635600eeb68d0bfcabb1ca5c81e991ef4a..6bdf91ed861cbd2e3ffda335b6dd76004e8cd591 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -127,14 +127,12 @@ void SCR_SetDrawFuncs(void)
 #ifndef NOWATER
 		spanfuncs[SPANDRAWFUNC_WATER] = R_DrawTranslucentWaterSpan_8;
 #endif
-#ifdef ESLOPE
 		spanfuncs[SPANDRAWFUNC_TILTED] = R_DrawTiltedSpan_8;
 		spanfuncs[SPANDRAWFUNC_TILTEDTRANS] = R_DrawTiltedTranslucentSpan_8;
 #ifndef NOWATER
 		spanfuncs[SPANDRAWFUNC_TILTEDWATER] = R_DrawTiltedTranslucentWaterSpan_8;
 #endif
 		spanfuncs[SPANDRAWFUNC_TILTEDSPLAT] = R_DrawTiltedSplat_8;
-#endif
 
 		// Lactozilla: Non-powers-of-two
 		spanfuncs_npo2[BASEDRAWFUNC] = R_DrawSpan_NPO2_8;
@@ -145,14 +143,12 @@ void SCR_SetDrawFuncs(void)
 #ifndef NOWATER
 		spanfuncs_npo2[SPANDRAWFUNC_WATER] = R_DrawTranslucentWaterSpan_NPO2_8;
 #endif
-#ifdef ESLOPE
 		spanfuncs_npo2[SPANDRAWFUNC_TILTED] = R_DrawTiltedSpan_NPO2_8;
 		spanfuncs_npo2[SPANDRAWFUNC_TILTEDTRANS] = R_DrawTiltedTranslucentSpan_NPO2_8;
 #ifndef NOWATER
 		spanfuncs_npo2[SPANDRAWFUNC_TILTEDWATER] = R_DrawTiltedTranslucentWaterSpan_NPO2_8;
 #endif
 		spanfuncs_npo2[SPANDRAWFUNC_TILTEDSPLAT] = R_DrawTiltedSplat_NPO2_8;
-#endif
 
 #ifdef RUSEASM
 		if (R_ASM)
diff --git a/src/screen.h b/src/screen.h
index 717ce9adc66c9511bce54238cc116ca8ffe49cd1..ddbd499bbd347d691c79e8ba0a4cbf416a300abd 100644
--- a/src/screen.h
+++ b/src/screen.h
@@ -140,13 +140,11 @@ enum
 #ifndef NOWATER
 	SPANDRAWFUNC_WATER,
 #endif
-#ifdef ESLOPE
 	SPANDRAWFUNC_TILTED,
 	SPANDRAWFUNC_TILTEDTRANS,
 	SPANDRAWFUNC_TILTEDSPLAT,
 #ifndef NOWATER
 	SPANDRAWFUNC_TILTEDWATER,
-#endif
 #endif
 
 	SPANDRAWFUNC_MAX
diff --git a/src/sdl/Srb2SDL-vc10.vcxproj b/src/sdl/Srb2SDL-vc10.vcxproj
index b334f6313614b5890c9b971b07068e7c404b6cec..7e260f4c01ed5a83960bd8f65bdc1f50fbad5ee6 100644
--- a/src/sdl/Srb2SDL-vc10.vcxproj
+++ b/src/sdl/Srb2SDL-vc10.vcxproj
@@ -284,6 +284,7 @@
     <ClInclude Include="..\r_patch.h" />
     <ClInclude Include="..\r_portal.h" />
     <ClInclude Include="..\r_segs.h" />
+    <ClInclude Include="..\r_skins.h" />
     <ClInclude Include="..\r_sky.h" />
     <ClInclude Include="..\r_splats.h" />
     <ClInclude Include="..\r_state.h" />
@@ -446,6 +447,7 @@
 	<ClCompile Include="..\r_patch.c" />
     <ClCompile Include="..\r_portal.c" />
     <ClCompile Include="..\r_segs.c" />
+    <ClCompile Include="..\r_skins.c" />
     <ClCompile Include="..\r_sky.c" />
     <ClCompile Include="..\r_splats.c" />
     <ClCompile Include="..\r_things.c" />
diff --git a/src/sdl/Srb2SDL-vc10.vcxproj.filters b/src/sdl/Srb2SDL-vc10.vcxproj.filters
index 3f61e87098fd08e732f7c521435d93fb63ca77f9..21820551a4ad1bfcfe85765d7975fa482c646e55 100644
--- a/src/sdl/Srb2SDL-vc10.vcxproj.filters
+++ b/src/sdl/Srb2SDL-vc10.vcxproj.filters
@@ -417,6 +417,9 @@
     <ClInclude Include="..\r_segs.h">
       <Filter>R_Rend</Filter>
     </ClInclude>
+    <ClInclude Include="..\r_skins.h">
+      <Filter>R_Rend</Filter>
+    </ClInclude>
     <ClInclude Include="..\r_sky.h">
       <Filter>R_Rend</Filter>
     </ClInclude>
@@ -849,6 +852,9 @@
     <ClCompile Include="..\r_segs.c">
       <Filter>R_Rend</Filter>
     </ClCompile>
+    <ClCompile Include="..\r_skins.c">
+      <Filter>R_Rend</Filter>
+    </ClCompile>
     <ClCompile Include="..\r_sky.c">
       <Filter>R_Rend</Filter>
     </ClCompile>
diff --git a/src/sdl/Srb2SDL-vc9.vcproj b/src/sdl/Srb2SDL-vc9.vcproj
index 3898aeba4efc53c9bd06fe38834d164ae31d64c1..9ef4301cc2b0bf605e7440086b89c79fba54b663 100644
--- a/src/sdl/Srb2SDL-vc9.vcproj
+++ b/src/sdl/Srb2SDL-vc9.vcproj
@@ -50,7 +50,7 @@
 				Name="VCCLCompilerTool"
 				Optimization="0"
 				AdditionalIncludeDirectories="&quot;$(ProjectDir)..\..\libs\libpng-src&quot;;&quot;$(ProjectDir)..\..\libs\zlib&quot;"
-				PreprocessorDefinitions="_DEBUG;USE_WGL_SWAP;DIRECTFULLSCREEN;HAVE_SDL;HWRENDER;HW3SOUND;HAVE_FILTER;HAVE_MIXER;USEASM;HAVE_PNG;HAVE_BLUA;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE"
+				PreprocessorDefinitions="_DEBUG;USE_WGL_SWAP;DIRECTFULLSCREEN;HAVE_SDL;HWRENDER;HW3SOUND;HAVE_FILTER;HAVE_MIXER;USEASM;HAVE_PNG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE"
 				MinimalRebuild="true"
 				BasicRuntimeChecks="3"
 				RuntimeLibrary="1"
@@ -145,7 +145,7 @@
 				Name="VCCLCompilerTool"
 				Optimization="0"
 				AdditionalIncludeDirectories="&quot;$(ProjectDir)..\..\libs\libpng-src&quot;;&quot;$(ProjectDir)..\..\libs\zlib&quot;"
-				PreprocessorDefinitions="_DEBUG;USE_WGL_SWAP;DIRECTFULLSCREEN;HAVE_SDL;HWRENDER;HW3SOUND;HAVE_FILTER;HAVE_MIXER;HAVE_PNG;HAVE_BLUA;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE"
+				PreprocessorDefinitions="_DEBUG;USE_WGL_SWAP;DIRECTFULLSCREEN;HAVE_SDL;HWRENDER;HW3SOUND;HAVE_FILTER;HAVE_MIXER;HAVE_PNG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE"
 				MinimalRebuild="true"
 				BasicRuntimeChecks="3"
 				RuntimeLibrary="1"
@@ -248,7 +248,7 @@
 				FavorSizeOrSpeed="1"
 				OmitFramePointers="true"
 				AdditionalIncludeDirectories="&quot;$(ProjectDir)..\..\libs\libpng-src&quot;;&quot;$(ProjectDir)..\..\libs\zlib&quot;"
-				PreprocessorDefinitions="NDEBUG;SDLMAIN;NO_STDIO_REDIRECT;USE_WGL_SWAP;DIRECTFULLSCREEN;HAVE_SDL;HWRENDER;HW3SOUND;HAVE_FILTER;HAVE_MIXER;USEASM;HAVE_PNG;HAVE_BLUA;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE"
+				PreprocessorDefinitions="NDEBUG;SDLMAIN;NO_STDIO_REDIRECT;USE_WGL_SWAP;DIRECTFULLSCREEN;HAVE_SDL;HWRENDER;HW3SOUND;HAVE_FILTER;HAVE_MIXER;USEASM;HAVE_PNG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE"
 				StringPooling="true"
 				RuntimeLibrary="0"
 				PrecompiledHeaderFile=".\..\..\objs\VC9\$(Platform)\$(Configuration)\SDL\Srb2SDL-vc9.pch"
@@ -350,7 +350,7 @@
 				FavorSizeOrSpeed="1"
 				OmitFramePointers="true"
 				AdditionalIncludeDirectories="&quot;$(ProjectDir)..\..\libs\libpng-src&quot;;&quot;$(ProjectDir)..\..\libs\zlib&quot;"
-				PreprocessorDefinitions="NDEBUG;SDLMAIN;NO_STDIO_REDIRECT;USE_WGL_SWAP;DIRECTFULLSCREEN;HAVE_SDL;HWRENDER;HW3SOUND;HAVE_FILTER;HAVE_MIXER;HAVE_PNG;HAVE_BLUA;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE"
+				PreprocessorDefinitions="NDEBUG;SDLMAIN;NO_STDIO_REDIRECT;USE_WGL_SWAP;DIRECTFULLSCREEN;HAVE_SDL;HWRENDER;HW3SOUND;HAVE_FILTER;HAVE_MIXER;HAVE_PNG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE"
 				StringPooling="true"
 				RuntimeLibrary="0"
 				PrecompiledHeaderFile=".\..\..\objs\VC9\$(Platform)\$(Configuration)\SDL\Srb2SDL-vc9.pch"
diff --git a/src/sdl/macosx/Srb2mac.xcodeproj/project.pbxproj b/src/sdl/macosx/Srb2mac.xcodeproj/project.pbxproj
index b615bc1dfd40daea3db522e7c2fc7520fc03b495..1822202651070b8330768516a26893a21b6384ca 100644
--- a/src/sdl/macosx/Srb2mac.xcodeproj/project.pbxproj
+++ b/src/sdl/macosx/Srb2mac.xcodeproj/project.pbxproj
@@ -1272,7 +1272,6 @@
 					HAVE_SDL,
 					HAVE_MIXER,
 					HAVE_PNG,
-					HAVE_BLUA,
 					LUA_USE_POSIX,
 					COMPVERSION,
 					HWRENDER,
@@ -1395,7 +1394,6 @@
 					HAVE_SDL,
 					HAVE_MIXER,
 					HAVE_PNG,
-					HAVE_BLUA,
 					LUA_USE_POSIX,
 					COMPVERSION,
 					HWRENDER,
diff --git a/src/sounds.c b/src/sounds.c
index a9d720d5c44800ef5dddf0eb208ac3db3a918388..ca943c2d06f0fd9d86e0a3616a86c84b857f65e3 100644
--- a/src/sounds.c
+++ b/src/sounds.c
@@ -15,7 +15,7 @@
 #include "i_sound.h"
 #include "sounds.h"
 #include "r_defs.h"
-#include "r_things.h"
+#include "r_skins.h"
 #include "z_zone.h"
 #include "w_wad.h"
 #include "lua_script.h"
diff --git a/src/st_stuff.c b/src/st_stuff.c
index 4864f2af694a964c5075a82f7535512779887930..ee7fc3f2166a148856aee09cb7febdfa655d6237 100644
--- a/src/st_stuff.c
+++ b/src/st_stuff.c
@@ -42,9 +42,7 @@
 #include "hardware/hw_main.h"
 #endif
 
-#ifdef HAVE_BLUA
 #include "lua_hud.h"
-#endif
 
 UINT16 objectsdrawn = 0;
 
@@ -969,11 +967,7 @@ static void ST_drawLivesArea(void)
 		V_DrawThinString(hudinfo[HUD_LIVES].x+18, hudinfo[HUD_LIVES].y, v_colmap, skins[stplyr->skin].hudname);
 
 	// Power Stones collected
-	if (G_RingSlingerGametype()
-#ifdef HAVE_BLUA
-	&& LUA_HudEnabled(hud_powerstones)
-#endif
-	)
+	if (G_RingSlingerGametype() && LUA_HudEnabled(hud_powerstones))
 	{
 		INT32 workx = hudinfo[HUD_LIVES].x+1, j;
 		if ((leveltime & 1) && stplyr->powers[pw_invulnerability] && (stplyr->powers[pw_sneakers] == stplyr->powers[pw_invulnerability])) // hack; extremely unlikely to be activated unintentionally
@@ -1341,17 +1335,11 @@ void ST_drawTitleCard(void)
 	if (!G_IsTitleCardAvailable())
 		return;
 
-#ifdef HAVE_BLUA
 	if (!LUA_HudEnabled(hud_stagetitle))
 		goto luahook;
-#endif
 
 	if (lt_ticker >= (lt_endtime + TICRATE))
-#ifdef HAVE_BLUA
 		goto luahook;
-#else
-		return;
-#endif
 
 	if ((lt_ticker-lt_lasttic) > 1)
 		lt_ticker = lt_lasttic+1;
@@ -1396,10 +1384,8 @@ void ST_drawTitleCard(void)
 
 	lt_lasttic = lt_ticker;
 
-#ifdef HAVE_BLUA
 luahook:
 	LUAh_TitleCardHUD(stplyr);
-#endif
 }
 
 //
@@ -1444,7 +1430,7 @@ static void ST_drawPowerupHUD(void)
 
 	if (stplyr->spectator || stplyr->playerstate != PST_LIVE)
 		return;
-	
+
 // ---------
 // Finish icon
 // ---------
@@ -1785,11 +1771,7 @@ static void ST_drawNiGHTSHUD(void)
 	const boolean oldspecialstage = (G_IsSpecialStage(gamemap) && !(maptol & TOL_NIGHTS));
 
 	// Drill meter
-	if (
-#ifdef HAVE_BLUA
-	LUA_HudEnabled(hud_nightsdrill) &&
-#endif
-	stplyr->powers[pw_carry] == CR_NIGHTSMODE)
+	if (LUA_HudEnabled(hud_nightsdrill) && stplyr->powers[pw_carry] == CR_NIGHTSMODE)
 	{
 		INT32 locx = 16, locy = 180;
 		INT32 dfill;
@@ -1831,9 +1813,7 @@ static void ST_drawNiGHTSHUD(void)
 	if (!oldspecialstage
 	// Don't display when the score is showing (it popping up for a split second when exiting a map is intentional)
 	&& !(stplyr->texttimer && stplyr->textvar == 4)
-#ifdef HAVE_BLUA
 	&& LUA_HudEnabled(hud_nightslink)
-#endif
 	&& ((cv_debug & DBG_NIGHTSBASIC) || stplyr->linkcount > 1)) // When debugging, show "0 Link".
 	{
 		ST_drawNiGHTSLink();
@@ -1847,10 +1827,8 @@ static void ST_drawNiGHTSHUD(void)
 	}
 
 	// Begin drawing brackets/chip display
-#ifdef HAVE_BLUA
 	if (LUA_HudEnabled(hud_nightsspheres))
 	{
-#endif
 	ST_DrawTopLeftOverlayPatch(16, 8, nbracket);
 	if (G_IsSpecialStage(gamemap))
 		ST_DrawTopLeftOverlayPatch(24, 16, (
@@ -1987,24 +1965,14 @@ static void ST_drawNiGHTSHUD(void)
 		V_DrawTallNum((total_spherecount >= 1000) ? 76 : 72, 8 + 11, V_PERPLAYER|V_SNAPTOTOP|V_SNAPTOLEFT|V_HUDTRANS, total_spherecount);
 	else
 		V_DrawTallNum(68, 8 + 11, V_PERPLAYER|V_SNAPTOTOP|V_SNAPTOLEFT|V_HUDTRANS, total_spherecount);
-#ifdef HAVE_BLUA
 	}
-#endif
 
 	// Score
-	if (!stplyr->exiting && !oldspecialstage
-#ifdef HAVE_BLUA
-	&& LUA_HudEnabled(hud_nightsscore)
-#endif
-	)
+	if (!stplyr->exiting && !oldspecialstage && LUA_HudEnabled(hud_nightsscore))
 		ST_DrawNightsOverlayNum(304<<FRACBITS, 14<<FRACBITS, FRACUNIT, V_PERPLAYER|V_SNAPTOTOP|V_SNAPTORIGHT, stplyr->marescore, nightsnum, SKINCOLOR_AZURE);
 
-	if (!stplyr->exiting
-#ifdef HAVE_BLUA
 	// TODO give this its own section for Lua
-	&& LUA_HudEnabled(hud_nightsscore)
-#endif
-	)
+	if (!stplyr->exiting && LUA_HudEnabled(hud_nightsscore))
 	{
 		if (modeattacking == ATTACKING_NIGHTS)
 		{
@@ -2027,11 +1995,7 @@ static void ST_drawNiGHTSHUD(void)
 	}
 
 	// Ideya time remaining
-	if (!stplyr->exiting && stplyr->nightstime > 0
-#ifdef HAVE_BLUA
-	&& LUA_HudEnabled(hud_nightstime)
-#endif
-	)
+	if (!stplyr->exiting && stplyr->nightstime > 0 && LUA_HudEnabled(hud_nightstime))
 	{
 		INT32 realnightstime = stplyr->nightstime/TICRATE;
 		INT32 numbersize;
@@ -2122,10 +2086,8 @@ static void ST_drawNiGHTSHUD(void)
 		}
 
 		// Records/extra text
-#ifdef HAVE_BLUA
 		if (LUA_HudEnabled(hud_nightsrecords))
-#endif
-		ST_drawNightsRecords();
+			ST_drawNightsRecords();
 	}
 }
 
@@ -2403,20 +2365,16 @@ static void ST_drawTeamHUD(void)
 	else
 		p = bmatcico;
 
-#ifdef HAVE_BLUA
 	if (LUA_HudEnabled(hud_teamscores))
-#endif
-	V_DrawSmallScaledPatch(BASEVIDWIDTH/2 - SEP - SHORT(p->width)/4, 4, V_HUDTRANS|V_PERPLAYER|V_SNAPTOTOP, p);
+		V_DrawSmallScaledPatch(BASEVIDWIDTH/2 - SEP - SHORT(p->width)/4, 4, V_HUDTRANS|V_PERPLAYER|V_SNAPTOTOP, p);
 
 	if (gametyperules & GTR_TEAMFLAGS)
 		p = rflagico;
 	else
 		p = rmatcico;
 
-#ifdef HAVE_BLUA
 	if (LUA_HudEnabled(hud_teamscores))
-#endif
-	V_DrawSmallScaledPatch(BASEVIDWIDTH/2 + SEP - SHORT(p->width)/4, 4, V_HUDTRANS|V_PERPLAYER|V_SNAPTOTOP, p);
+		V_DrawSmallScaledPatch(BASEVIDWIDTH/2 + SEP - SHORT(p->width)/4, 4, V_HUDTRANS|V_PERPLAYER|V_SNAPTOTOP, p);
 
 	if (!(gametyperules & GTR_TEAMFLAGS))
 		goto num;
@@ -2427,18 +2385,12 @@ static void ST_drawTeamHUD(void)
 		// Show which flags aren't at base.
 		for (i = 0; i < MAXPLAYERS; i++)
 		{
-			if (players[i].gotflag & GF_BLUEFLAG // Blue flag isn't at base
-#ifdef HAVE_BLUA
-			&& LUA_HudEnabled(hud_teamscores)
-#endif
-			)
+			// Blue flag isn't at base
+			if (players[i].gotflag & GF_BLUEFLAG && LUA_HudEnabled(hud_teamscores))
 				V_DrawScaledPatch(BASEVIDWIDTH/2 - SEP - SHORT(nonicon->width)/2, 0, V_HUDTRANS|V_PERPLAYER|V_SNAPTOTOP, nonicon);
 
-			if (players[i].gotflag & GF_REDFLAG // Red flag isn't at base
-#ifdef HAVE_BLUA
-			&& LUA_HudEnabled(hud_teamscores)
-#endif
-			)
+			// Red flag isn't at base
+			if (players[i].gotflag & GF_REDFLAG && LUA_HudEnabled(hud_teamscores))
 				V_DrawScaledPatch(BASEVIDWIDTH/2 + SEP - SHORT(nonicon2->width)/2, 0, V_HUDTRANS|V_PERPLAYER|V_SNAPTOTOP, nonicon2);
 
 			whichflag |= players[i].gotflag;
@@ -2449,32 +2401,20 @@ static void ST_drawTeamHUD(void)
 
 		// Display a countdown timer showing how much time left until the flag returns to base.
 		{
-			if (blueflag && blueflag->fuse > 1
-#ifdef HAVE_BLUA
-			&& LUA_HudEnabled(hud_teamscores)
-#endif
-			)
+			if (blueflag && blueflag->fuse > 1 && LUA_HudEnabled(hud_teamscores))
 				V_DrawCenteredString(BASEVIDWIDTH/2 - SEP, 8, V_YELLOWMAP|V_HUDTRANS|V_PERPLAYER|V_SNAPTOTOP, va("%u", (blueflag->fuse / TICRATE)));
 
-			if (redflag && redflag->fuse > 1
-#ifdef HAVE_BLUA
-			&& LUA_HudEnabled(hud_teamscores)
-#endif
-			)
+			if (redflag && redflag->fuse > 1 && LUA_HudEnabled(hud_teamscores))
 				V_DrawCenteredString(BASEVIDWIDTH/2 + SEP, 8, V_YELLOWMAP|V_HUDTRANS|V_PERPLAYER|V_SNAPTOTOP, va("%u", (redflag->fuse / TICRATE)));
 		}
 	}
 
 num:
-#ifdef HAVE_BLUA
 	if (LUA_HudEnabled(hud_teamscores))
-#endif
-	V_DrawCenteredString(BASEVIDWIDTH/2 - SEP, 16, V_HUDTRANS|V_PERPLAYER|V_SNAPTOTOP, va("%u", bluescore));
+		V_DrawCenteredString(BASEVIDWIDTH/2 - SEP, 16, V_HUDTRANS|V_PERPLAYER|V_SNAPTOTOP, va("%u", bluescore));
 
-#ifdef HAVE_BLUA
 	if (LUA_HudEnabled(hud_teamscores))
-#endif
-	V_DrawCenteredString(BASEVIDWIDTH/2 + SEP, 16, V_HUDTRANS|V_PERPLAYER|V_SNAPTOTOP, va("%u", redscore));
+		V_DrawCenteredString(BASEVIDWIDTH/2 + SEP, 16, V_HUDTRANS|V_PERPLAYER|V_SNAPTOTOP, va("%u", redscore));
 
 #undef SEP
 }
@@ -2661,24 +2601,14 @@ static void ST_overlayDrawer(void)
 			ST_drawNiGHTSHUD();
 		else
 		{
-#ifdef HAVE_BLUA
 			if (LUA_HudEnabled(hud_score))
-#endif
-			ST_drawScore();
-#ifdef HAVE_BLUA
+				ST_drawScore();
 			if (LUA_HudEnabled(hud_time))
-#endif
-			ST_drawTime();
-#ifdef HAVE_BLUA
+				ST_drawTime();
 			if (LUA_HudEnabled(hud_rings))
-#endif
-			ST_drawRings();
+				ST_drawRings();
 
-			if (!modeattacking
-#ifdef HAVE_BLUA
-			&& LUA_HudEnabled(hud_lives)
-#endif
-			)
+			if (!modeattacking && LUA_HudEnabled(hud_lives))
 				ST_drawLivesArea();
 		}
 	}
@@ -2753,11 +2683,7 @@ static void ST_overlayDrawer(void)
 		// Draw Match-related stuff
 		//\note Match HUD is drawn no matter what gametype.
 		// ... just not if you're a spectator.
-		if (!stplyr->spectator
-#ifdef HAVE_BLUA
-		&& (LUA_HudEnabled(hud_weaponrings))
-#endif
-		)
+		if (!stplyr->spectator && LUA_HudEnabled(hud_weaponrings))
 			ST_drawMatchHUD();
 
 		// Race HUD Stuff
@@ -2798,20 +2724,14 @@ static void ST_overlayDrawer(void)
 	else if (!(netgame || multiplayer) && cv_powerupdisplay.value == 2)
 		ST_drawPowerupHUD(); // same as it ever was...
 
-#ifdef HAVE_BLUA
 	if (!(netgame || multiplayer) || !hu_showscores)
 		LUAh_GameHUD(stplyr);
-#endif
 
 	// draw level title Tails
 	if (stagetitle && (!WipeInAction) && (!WipeStageTitle))
 		ST_drawTitleCard();
 
-	if (!hu_showscores && (netgame || multiplayer)
-#ifdef HAVE_BLUA
-		&& LUA_HudEnabled(hud_textspectator)
-#endif
-	)
+	if (!hu_showscores && (netgame || multiplayer) && LUA_HudEnabled(hud_textspectator))
 		ST_drawTextHUD();
 
 	if (modeattacking && !(demoplayback && hu_showscores))
diff --git a/src/w_wad.c b/src/w_wad.c
index e96afd05004d90ce1be94d9e6bb4cdc2dabf283a..f7ccc175b87df030d492b1e9b6469ac42a99b070 100644
--- a/src/w_wad.c
+++ b/src/w_wad.c
@@ -189,7 +189,7 @@ FILE *W_OpenWadFile(const char **filename, boolean useerrors)
 static inline void W_LoadDehackedLumpsPK3(UINT16 wadnum, boolean mainfile)
 {
 	UINT16 posStart, posEnd;
-#ifdef HAVE_BLUA
+
 	posStart = W_CheckNumForFolderStartPK3("Lua/", wadnum, 0);
 	if (posStart != INT16_MAX)
 	{
@@ -198,7 +198,7 @@ static inline void W_LoadDehackedLumpsPK3(UINT16 wadnum, boolean mainfile)
 		for (; posStart < posEnd; posStart++)
 			LUA_LoadLump(wadnum, posStart);
 	}
-#endif
+
 	posStart = W_CheckNumForFolderStartPK3("SOC/", wadnum, 0);
 	if (posStart != INT16_MAX)
 	{
@@ -224,7 +224,6 @@ static inline void W_LoadDehackedLumps(UINT16 wadnum, boolean mainfile)
 {
 	UINT16 lump;
 
-#ifdef HAVE_BLUA
 	// Find Lua scripts before SOCs to allow new A_Actions in SOC editing.
 	{
 		lumpinfo_t *lump_p = wadfiles[wadnum]->lumpinfo;
@@ -232,7 +231,6 @@ static inline void W_LoadDehackedLumps(UINT16 wadnum, boolean mainfile)
 			if (memcmp(lump_p->name,"LUA_",4)==0)
 				LUA_LoadLump(wadnum, lump);
 	}
-#endif
 
 	{
 		lumpinfo_t *lump_p = wadfiles[wadnum]->lumpinfo;
@@ -749,11 +747,9 @@ UINT16 W_InitFile(const char *filename, boolean mainfile, boolean startup)
 	case RET_SOC:
 		lumpinfo = ResGetLumpsStandalone(handle, &numlumps, "OBJCTCFG");
 		break;
-#ifdef HAVE_BLUA
 	case RET_LUA:
 		lumpinfo = ResGetLumpsStandalone(handle, &numlumps, "LUA_INIT");
 		break;
-#endif
 	case RET_PK3:
 		lumpinfo = ResGetLumpsZip(handle, &numlumps);
 		break;
@@ -818,11 +814,9 @@ UINT16 W_InitFile(const char *filename, boolean mainfile, boolean startup)
 		CONS_Printf(M_GetText("Loading SOC from %s\n"), wadfile->filename);
 		DEH_LoadDehackedLumpPwad(numwadfiles - 1, 0, mainfile);
 		break;
-#ifdef HAVE_BLUA
 	case RET_LUA:
 		LUA_LoadLump(numwadfiles - 1, 0);
 		break;
-#endif
 	default:
 		break;
 	}
@@ -1860,10 +1854,7 @@ static int W_VerifyFile(const char *filename, lumpchecklist_t *checklist,
 	{
 		// detect wad file by the absence of the other supported extensions
 		if (stricmp(&filename[strlen(filename) - 4], ".soc")
-#ifdef HAVE_BLUA
-		&& stricmp(&filename[strlen(filename) - 4], ".lua")
-#endif
-		)
+		&& stricmp(&filename[strlen(filename) - 4], ".lua"))
 		{
 			goodfile = W_VerifyWAD(handle, checklist, status);
 		}
diff --git a/src/win32/Srb2win-vc9.vcproj b/src/win32/Srb2win-vc9.vcproj
index a64b8638cde6986a2377440a62bfe060293cb93f..4c17bb6f74bec52209d79ac5fc03854f674e5438 100644
--- a/src/win32/Srb2win-vc9.vcproj
+++ b/src/win32/Srb2win-vc9.vcproj
@@ -55,7 +55,7 @@
 				Optimization="0"
 				OmitFramePointers="false"
 				AdditionalIncludeDirectories="&quot;$(ProjectDir)..\..\libs\libpng-src&quot;;&quot;$(ProjectDir)..\..\libs\zlib&quot;"
-				PreprocessorDefinitions="_DEBUG;_WINDOWS;USEASM;HAVE_PNG;COMPVERSION;HAVE_BLUA;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE"
+				PreprocessorDefinitions="_DEBUG;_WINDOWS;USEASM;HAVE_PNG;COMPVERSION;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE"
 				MinimalRebuild="true"
 				RuntimeLibrary="1"
 				EnableFunctionLevelLinking="true"
@@ -153,7 +153,7 @@
 				Optimization="0"
 				OmitFramePointers="false"
 				AdditionalIncludeDirectories="&quot;$(ProjectDir)..\..\libs\libpng-src&quot;;&quot;$(ProjectDir)..\..\libs\zlib&quot;"
-				PreprocessorDefinitions="_DEBUG;_WINDOWS;HAVE_PNG;COMPVERSION;HAVE_BLUA;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE"
+				PreprocessorDefinitions="_DEBUG;_WINDOWS;HAVE_PNG;COMPVERSION;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE"
 				MinimalRebuild="true"
 				BasicRuntimeChecks="3"
 				SmallerTypeCheck="true"
@@ -256,7 +256,7 @@
 				FavorSizeOrSpeed="1"
 				OmitFramePointers="true"
 				AdditionalIncludeDirectories="&quot;$(ProjectDir)..\..\libs\libpng-src&quot;;&quot;$(ProjectDir)..\..\libs\zlib&quot;"
-				PreprocessorDefinitions="NDEBUG;_WINDOWS;USEASM;HAVE_PNG;COMPVERSION;HAVE_BLUA;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE"
+				PreprocessorDefinitions="NDEBUG;_WINDOWS;USEASM;HAVE_PNG;COMPVERSION;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE"
 				StringPooling="true"
 				RuntimeLibrary="0"
 				EnableFunctionLevelLinking="true"
@@ -356,7 +356,7 @@
 				FavorSizeOrSpeed="1"
 				OmitFramePointers="true"
 				AdditionalIncludeDirectories="&quot;$(ProjectDir)..\..\libs\libpng-src&quot;;&quot;$(ProjectDir)..\..\libs\zlib&quot;"
-				PreprocessorDefinitions="NDEBUG;_WINDOWS;HAVE_PNG;COMPVERSION;HAVE_BLUA;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE"
+				PreprocessorDefinitions="NDEBUG;_WINDOWS;HAVE_PNG;COMPVERSION;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE"
 				StringPooling="true"
 				RuntimeLibrary="0"
 				EnableFunctionLevelLinking="true"
diff --git a/src/y_inter.c b/src/y_inter.c
index 36cb64d0625de2b1d3862cf85bcd0fcf6cbbe486..94a289817192f89e8da0007006638086c1aa5be4 100644
--- a/src/y_inter.c
+++ b/src/y_inter.c
@@ -19,7 +19,7 @@
 #include "i_video.h"
 #include "p_tick.h"
 #include "r_defs.h"
-#include "r_things.h"
+#include "r_skins.h"
 #include "s_sound.h"
 #include "st_stuff.h"
 #include "v_video.h"
@@ -37,9 +37,7 @@
 #include "m_cond.h" // condition sets
 #include "lua_hook.h" // IntermissionThinker hook
 
-#ifdef HAVE_BLUA
 #include "lua_hud.h"
-#endif
 
 #ifdef HWRENDER
 #include "hardware/hw_main.h"
@@ -330,9 +328,7 @@ void Y_IntermissionDrawer(void)
 
 	if (intertype == int_none)
 	{
-#ifdef HAVE_BLUA
 		LUAh_IntermissionHUD();
-#endif
 		return;
 	}
 
@@ -384,11 +380,9 @@ void Y_IntermissionDrawer(void)
 	else
 		V_DrawPatchFill(bgtile);
 
-#ifdef HAVE_BLUA
 	LUAh_IntermissionHUD();
 	if (!LUA_HudEnabled(hud_intermissiontally))
 		goto skiptallydrawer;
-#endif
 
 dontdrawbg:
 	if (intertype == int_coop)
@@ -944,11 +938,9 @@ dontdrawbg:
 		}
 	}
 
-#ifdef HAVE_BLUA
 skiptallydrawer:
 	if (!LUA_HudEnabled(hud_intermissionmessages))
 		return;
-#endif
 
 	if (timer)
 		V_DrawCenteredString(BASEVIDWIDTH/2, 188, V_YELLOWMAP,
@@ -973,9 +965,7 @@ void Y_Ticker(void)
 	if (paused || P_AutoPause())
 		return;
 
-#ifdef HAVE_BLUA
 	LUAh_IntermissionThinker();
-#endif
 
 	intertic++;
 
diff --git a/src/z_zone.c b/src/z_zone.c
index 67bc2b519b90cf881b0d97eb1ac7e0ee54519673..96dcd0cba5fbd7bb865dc4eb1317a8b3d2efaa6f 100644
--- a/src/z_zone.c
+++ b/src/z_zone.c
@@ -217,11 +217,9 @@ void Z_Free(void *ptr)
 	CONS_Debug(DBG_MEMORY, "Z_Free at %s:%d\n", file, line);
 #endif
 
-#ifdef HAVE_BLUA
 	// anything that isn't by lua gets passed to lua just in case.
 	if (block->tag != PU_LUA)
 		LUA_InvalidateUserdata(ptr);
-#endif
 
 	// TODO: if zdebugging, make sure no other block has a user
 	// that is about to be freed.