diff --git a/docs/rh-log.txt b/docs/rh-log.txt
index 0058f53d4..ad7d36bf8 100644
--- a/docs/rh-log.txt
+++ b/docs/rh-log.txt
@@ -1,4 +1,11 @@
October 5, 2008 (Changes by Graf Zahl)
+- Finally has the right idea how to restore Doom's original clipping of projectiles
+ against decorations without breaking anything newer:
+ Added a new 'projectilepassheight' property that defines an alternative height
+ that is only used when checking a projectile's movement against this actor.
+ If the value is positive it is used regardless of other settings, if it is
+ negative, its absolute will be used if a new compatibility option is enabled
+ and if it is 0 the normal height will be used.
- Fixed: Powerup.Color's handler contained an unnecessary 'else' which resulted
in opaque powerup blends.
diff --git a/src/actor.h b/src/actor.h
index 0dfa13b7e..170235f38 100644
--- a/src/actor.h
+++ b/src/actor.h
@@ -650,6 +650,7 @@ public:
struct sector_t *ceilingsector;
FTextureID ceilingpic; // contacted sec ceilingpic
fixed_t radius, height; // for movement checking
+ fixed_t projectilepassheight; // height for clipping projectile movement against this actor
fixed_t momx, momy, momz; // momentums
SDWORD tics; // state tic counter
FState *state;
diff --git a/src/d_dehacked.cpp b/src/d_dehacked.cpp
index 5f32dc31f..0de22dcf2 100644
--- a/src/d_dehacked.cpp
+++ b/src/d_dehacked.cpp
@@ -746,6 +746,7 @@ static int PatchThing (int thingy)
else if (linelen == 6 && stricmp (Line1, "Height") == 0)
{
info->height = val;
+ info->projectilepassheight = 0; // needs to be disabled
hadHeight = true;
}
else if (linelen == 14 && stricmp (Line1, "Missile damage") == 0)
@@ -1009,6 +1010,7 @@ static int PatchThing (int thingy)
thingy <= NumOrgHeights && thingy > 0)
{
info->height = OrgHeights[thingy - 1] * FRACUNIT;
+ info->projectilepassheight = 0;
}
// If the thing's shadow changed, change its fuzziness if not already specified
if ((info->flags ^ oldflags) & MF_SHADOW)
diff --git a/src/d_main.cpp b/src/d_main.cpp
index ce8aef512..7ee5f6e60 100644
--- a/src/d_main.cpp
+++ b/src/d_main.cpp
@@ -486,6 +486,7 @@ CVAR (Flag, compat_boomscroll, compatflags, COMPATF_BOOMSCROLL);
CVAR (Flag, compat_invisibility,compatflags, COMPATF_INVISIBILITY);
CVAR (Flag, compat_silentinstantfloors,compatflags, COMPATF_SILENT_INSTANT_FLOORS);
CVAR (Flag, compat_sectorsounds,compatflags, COMPATF_SECTORSOUNDS);
+CVAR (Flag, compat_missileclip, compatflags, COMPATF_MISSILECLIP);
//==========================================================================
//
diff --git a/src/doomdef.h b/src/doomdef.h
index f43164710..036351931 100644
--- a/src/doomdef.h
+++ b/src/doomdef.h
@@ -273,6 +273,7 @@ enum
COMPATF_INVISIBILITY = 1 << 16, // Monsters can see semi-invisible players
COMPATF_SILENT_INSTANT_FLOORS = 1<<17, // Instantly moving floors are not silent
COMPATF_SECTORSOUNDS = 1 << 18, // Sector sounds use original method for sound origin.
+ COMPATF_MISSILECLIP = 1 << 19, // Use original Doom heights for clipping against projectiles
};
// phares 3/20/98:
diff --git a/src/g_level.cpp b/src/g_level.cpp
index bfd6f13d5..7274e18f0 100644
--- a/src/g_level.cpp
+++ b/src/g_level.cpp
@@ -351,6 +351,7 @@ static const char *MapInfoMapLevel[] =
"compat_invisibility",
"compat_silent_instant_floors",
"compat_sectorsounds",
+ "compat_missileclip",
"bordertexture",
"f1", // [RC] F1 help
"noinfighting",
@@ -503,6 +504,7 @@ MapHandlers[] =
{ MITYPE_COMPATFLAG, COMPATF_INVISIBILITY},
{ MITYPE_COMPATFLAG, COMPATF_SILENT_INSTANT_FLOORS},
{ MITYPE_COMPATFLAG, COMPATF_SECTORSOUNDS},
+ { MITYPE_COMPATFLAG, COMPATF_MISSILECLIP},
{ MITYPE_LUMPNAME, lioffset(bordertexture), 0 },
{ MITYPE_LUMPNAME, lioffset(f1), 0, },
{ MITYPE_SCFLAGS, LEVEL_NOINFIGHTING, ~LEVEL_TOTALINFIGHTING },
diff --git a/src/m_options.cpp b/src/m_options.cpp
index 0e20c5f9d..e7bb69b4b 100644
--- a/src/m_options.cpp
+++ b/src/m_options.cpp
@@ -1103,6 +1103,7 @@ static menuitem_t CompatibilityItems[] = {
{ bitflag, "Boom scrollers are additive", {&compatflags}, {0}, {0}, {0}, {(value_t *)COMPATF_BOOMSCROLL} },
{ bitflag, "Inst. moving floors are not silent", {&compatflags}, {0}, {0}, {0}, {(value_t *)COMPATF_SILENT_INSTANT_FLOORS} },
{ bitflag, "Sector sounds use center as source", {&compatflags}, {0}, {0}, {0}, {(value_t *)COMPATF_SECTORSOUNDS} },
+ { bitflag, "Use Doom heights for missile clipping", {&compatflags}, {0}, {0}, {0}, {(value_t *)COMPATF_MISSILECLIP} },
{ discrete, "Interpolate monster movement", {&nomonsterinterpolation}, {2.0}, {0.0}, {0.0}, {NoYes} },
};
diff --git a/src/p_map.cpp b/src/p_map.cpp
index 77ef763b1..da750cb6d 100644
--- a/src/p_map.cpp
+++ b/src/p_map.cpp
@@ -745,8 +745,24 @@ bool PIT_CheckThing (AActor *thing, FCheckPosition &tm)
{
return true;
}
+
+ int clipheight;
+
+ if (thing->projectilepassheight > 0)
+ {
+ clipheight = thing->projectilepassheight;
+ }
+ else if (thing->projectilepassheight < 0 && (i_compatflags & COMPATF_MISSILECLIP))
+ {
+ clipheight = -thing->projectilepassheight;
+ }
+ else
+ {
+ clipheight = thing->height;
+ }
+
// Check if it went over / under
- if (tm.thing->z > thing->z + thing->height)
+ if (tm.thing->z > thing->z + clipheight)
{ // Over thing
return true;
}
diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp
index 39ab102fb..014763e75 100644
--- a/src/p_mobj.cpp
+++ b/src/p_mobj.cpp
@@ -220,6 +220,7 @@ void AActor::Serialize (FArchive &arc)
<< ceilingsector
<< radius
<< height
+ << projectilepassheight
<< momx
<< momy
<< momz
diff --git a/src/thingdef/thingdef_properties.cpp b/src/thingdef/thingdef_properties.cpp
index 360f106ea..77a837be8 100644
--- a/src/thingdef/thingdef_properties.cpp
+++ b/src/thingdef/thingdef_properties.cpp
@@ -695,6 +695,15 @@ DEFINE_PROPERTY(height, F, Actor)
defaults->height=id;
}
+//==========================================================================
+//
+//==========================================================================
+DEFINE_PROPERTY(projectilepassheight, F, Actor)
+{
+ PROP_FIXED_PARM(id, 0);
+ defaults->projectilepassheight=id;
+}
+
//==========================================================================
//
//==========================================================================
diff --git a/src/version.h b/src/version.h
index ff6bff6a5..3a2d9d039 100644
--- a/src/version.h
+++ b/src/version.h
@@ -75,7 +75,7 @@
// SAVESIG should match SAVEVER.
// MINSAVEVER is the minimum level snapshot version that can be loaded.
-#define MINSAVEVER 1215
+#define MINSAVEVER 1253
#if SVN_REVISION_NUMBER < MINSAVEVER
// Never write a savegame with a version lower than what we need
diff --git a/wadsrc/static/actors/doom/doomdecorations.txt b/wadsrc/static/actors/doom/doomdecorations.txt
index 4dcdc885f..3d2073fed 100644
--- a/wadsrc/static/actors/doom/doomdecorations.txt
+++ b/wadsrc/static/actors/doom/doomdecorations.txt
@@ -6,6 +6,7 @@ ACTOR TechLamp 85
Game Doom
Radius 16
Height 80
+ ProjectilePassHeight -16
+SOLID
States
{
@@ -22,6 +23,7 @@ ACTOR TechLamp2 86
Game Doom
Radius 16
Height 60
+ ProjectilePassHeight -16
+SOLID
States
{
@@ -38,6 +40,7 @@ ACTOR Column 2028
Game Doom
Radius 16
Height 48
+ ProjectilePassHeight -16
+SOLID
States
{
@@ -54,6 +57,7 @@ ACTOR TallGreenColumn 30
Game Doom
Radius 16
Height 52
+ ProjectilePassHeight -16
+SOLID
States
{
@@ -70,6 +74,7 @@ ACTOR ShortGreenColumn 31
Game Doom
Radius 16
Height 40
+ ProjectilePassHeight -16
+SOLID
States
{
@@ -86,6 +91,7 @@ ACTOR TallRedColumn 32
Game Doom
Radius 16
Height 52
+ ProjectilePassHeight -16
+SOLID
States
{
@@ -102,6 +108,7 @@ ACTOR ShortRedColumn 33
Game Doom
Radius 16
Height 40
+ ProjectilePassHeight -16
+SOLID
States
{
@@ -118,6 +125,7 @@ ACTOR SkullColumn 37
Game Doom
Radius 16
Height 40
+ ProjectilePassHeight -16
+SOLID
States
{
@@ -134,6 +142,7 @@ ACTOR HeartColumn 36
Game Doom
Radius 16
Height 40
+ ProjectilePassHeight -16
+SOLID
States
{
@@ -150,6 +159,7 @@ ACTOR EvilEye 41
Game Doom
Radius 16
Height 54
+ ProjectilePassHeight -16
+SOLID
States
{
@@ -166,6 +176,7 @@ ACTOR FloatingSkull 42
Game Doom
Radius 16
Height 26
+ ProjectilePassHeight -16
+SOLID
States
{
@@ -182,6 +193,7 @@ ACTOR TorchTree 43
Game Doom
Radius 16
Height 56
+ ProjectilePassHeight -16
+SOLID
States
{
@@ -198,6 +210,7 @@ ACTOR BlueTorch 44
Game Doom
Radius 16
Height 68
+ ProjectilePassHeight -16
+SOLID
States
{
@@ -214,6 +227,7 @@ ACTOR GreenTorch 45
Game Doom
Radius 16
Height 68
+ ProjectilePassHeight -16
+SOLID
States
{
@@ -230,6 +244,7 @@ ACTOR RedTorch 46
Game Doom
Radius 16
Height 68
+ ProjectilePassHeight -16
+SOLID
States
{
@@ -246,6 +261,7 @@ ACTOR ShortBlueTorch 55
Game Doom
Radius 16
Height 37
+ ProjectilePassHeight -16
+SOLID
States
{
@@ -262,6 +278,7 @@ ACTOR ShortGreenTorch 56
Game Doom
Radius 16
Height 37
+ ProjectilePassHeight -16
+SOLID
States
{
@@ -278,6 +295,7 @@ ACTOR ShortRedTorch 57
Game Doom
Radius 16
Height 37
+ ProjectilePassHeight -16
+SOLID
States
{
@@ -294,6 +312,7 @@ ACTOR Stalagtite 47
Game Doom
Radius 16
Height 40
+ ProjectilePassHeight -16
+SOLID
States
{
@@ -310,6 +329,7 @@ ACTOR TechPillar 48
Game Doom
Radius 16
Height 128
+ ProjectilePassHeight -16
+SOLID
States
{
@@ -326,6 +346,7 @@ ACTOR Candlestick 34
Game Doom
Radius 20
Height 14
+ ProjectilePassHeight -16
States
{
Spawn:
@@ -341,6 +362,7 @@ ACTOR Candelabra 35
Game Doom
Radius 16
Height 60
+ ProjectilePassHeight -16
+SOLID
States
{
@@ -489,6 +511,7 @@ ACTOR HeadOnAStick 27
Game Doom
Radius 16
Height 56
+ ProjectilePassHeight -16
+SOLID
States
{
@@ -505,6 +528,7 @@ ACTOR HeadsOnAStick 28
Game Doom
Radius 16
Height 64
+ ProjectilePassHeight -16
+SOLID
States
{
@@ -521,6 +545,7 @@ ACTOR HeadCandles 29
Game Doom
Radius 16
Height 42
+ ProjectilePassHeight -16
+SOLID
States
{
@@ -537,6 +562,7 @@ ACTOR DeadStick 25
Game Doom
Radius 16
Height 64
+ ProjectilePassHeight -16
+SOLID
States
{
@@ -553,6 +579,7 @@ ACTOR LiveStick 26
Game Doom
Radius 16
Height 64
+ ProjectilePassHeight -16
+SOLID
States
{
@@ -570,6 +597,7 @@ ACTOR BigTree 54
Game Doom
Radius 32
Height 108
+ ProjectilePassHeight -16
+SOLID
States
{
@@ -587,6 +615,7 @@ ACTOR BurningBarrel 70
SpawnID 149
Radius 16
Height 32
+ ProjectilePassHeight -16
+SOLID
States
{
diff --git a/zdoom.vcproj b/zdoom.vcproj
index a8d235bc9..d101c531e 100644
--- a/zdoom.vcproj
+++ b/zdoom.vcproj
@@ -1063,6 +1063,14 @@
RelativePath=".\src\thingdef\thingdef_exp.cpp"
>
+
+
+
+