ref: 28f0259d48be125dd16b74ae81d0a23dc430a08a
dir: /doom-skywallhit/
bullet puffs and plasma splashes don't spawn, and rockets don't explode, when fired against a linedef bridging two sectors of differing heights but with a sky texture. example: ultimate doom e4m6: fire at the green structure surrounded by a moat of lava outside, or at the moat's walls. the "sky hack" is meant to show the sky (in this particular configuration) rather than a texture, and to make projectiles disappear when fired at this "sky". however, the check for the wall's attributes and the projectiles coordinates is wrong. this patches fixes that. however, it affects gameplay, and as such, demos will desync anytime this mechanism is encountered. it is therefore turned off by default. not sure if this should be merged. TODO: better explanation, more testing diff -Naur a/sys/src/games/doom/d_main.c b/sys/src/games/doom/d_main.c --- a/sys/src/games/doom/d_main.c Sun Aug 2 19:57:59 2015 +++ b/sys/src/games/doom/d_main.c Fri Aug 21 15:09:01 2015 @@ -94,6 +94,8 @@ boolean noztele; boolean nobounce; +/* demo breaking bug fixes */ +boolean noskyabs; //extern int soundVolume; //extern int sfxVolume; @@ -743,6 +745,8 @@ noztele = 1; if (M_CheckParm ("-nobounce") && (gamemode == commercial || gamemode == registered)) nobounce = 1; + if (M_CheckParm ("-noskyabs")) + noskyabs = 1; if (M_CheckParm ("-altdeath")) deathmatch = 2; else if (M_CheckParm ("-deathmatch")) diff -Naur a/sys/src/games/doom/p_local.h b/sys/src/games/doom/p_local.h --- a/sys/src/games/doom/p_local.h Sun Aug 2 19:57:59 2015 +++ b/sys/src/games/doom/p_local.h Fri Aug 21 15:05:02 2015 @@ -62,6 +62,7 @@ extern boolean noztele; extern boolean nobounce; +extern boolean noskyabs; // diff -Naur a/sys/src/games/doom/p_map.c b/sys/src/games/doom/p_map.c --- a/sys/src/games/doom/p_map.c Mon Jul 27 20:08:20 2015 +++ b/sys/src/games/doom/p_map.c Fri Aug 21 15:10:30 2015 @@ -958,7 +958,8 @@ return false; // it's a sky hack wall - if (li->backsector && li->backsector->ceilingpic == skyflatnum) + if (li->backsector != nil && li->backsector->ceilingpic == skyflatnum + && (!noskyabs || z > li->backsector->ceilingheight)) return false; } diff -Naur a/sys/src/games/doom/p_mobj.c b/sys/src/games/doom/p_mobj.c --- a/sys/src/games/doom/p_mobj.c Sun Aug 2 19:57:59 2015 +++ b/sys/src/games/doom/p_mobj.c Fri Aug 21 15:03:11 2015 @@ -173,9 +173,10 @@ else if (mo->flags & MF_MISSILE) { // explode a missile - if (ceilingline && - ceilingline->backsector && - ceilingline->backsector->ceilingpic == skyflatnum) + if (ceilingline != nil && + ceilingline->backsector != nil && + ceilingline->backsector->ceilingpic == skyflatnum && + (!noskyabs || mo->z > ceilingline->backsector->ceilingheight)) { // Hack to prevent missiles exploding // against the sky.