diff options
author | Simon Howard | 2011-09-11 23:40:44 +0000 |
---|---|---|
committer | Simon Howard | 2011-09-11 23:40:44 +0000 |
commit | efd15d965dee947a04727bb62f4e2092cf28732f (patch) | |
tree | 730d99c1e88d5e3145e552ad69dec52d30026d01 /src/doom/p_map.c | |
parent | 4d17ab361e90a75dc6deefd37e6eb2ba0610b386 (diff) | |
parent | 11024d8214580d63ca7a9e70a121f5ff542a2fce (diff) | |
download | chocolate-doom-efd15d965dee947a04727bb62f4e2092cf28732f.tar.gz chocolate-doom-efd15d965dee947a04727bb62f4e2092cf28732f.tar.bz2 chocolate-doom-efd15d965dee947a04727bb62f4e2092cf28732f.zip |
Merge from raven-branch.
Subversion-branch: /branches/strife-branch
Subversion-revision: 2367
Diffstat (limited to 'src/doom/p_map.c')
-rw-r--r-- | src/doom/p_map.c | 59 |
1 files changed, 30 insertions, 29 deletions
diff --git a/src/doom/p_map.c b/src/doom/p_map.c index 78102bdf..7e92e23a 100644 --- a/src/doom/p_map.c +++ b/src/doom/p_map.c @@ -885,24 +885,16 @@ PTR_AimTraverse (intercept_t* in) dist = FixedMul (attackrange, in->frac); - // Return false if there is no back sector. This should never - // be the case if the line is two-sided; however, some WADs - // (eg. ottawau.wad) use this as an "impassible glass" trick - // and rely on Vanilla Doom's (unintentional) support for this. - - if (li->backsector == NULL) - { - return false; - } - - if (li->frontsector->floorheight != li->backsector->floorheight) + if (li->backsector == NULL + || li->frontsector->floorheight != li->backsector->floorheight) { slope = FixedDiv (openbottom - shootz , dist); if (slope > bottomslope) bottomslope = slope; } - if (li->frontsector->ceilingheight != li->backsector->ceilingheight) + if (li->backsector == NULL + || li->frontsector->ceilingheight != li->backsector->ceilingheight) { slope = FixedDiv (opentop - shootz , dist); if (slope < topslope) @@ -983,26 +975,35 @@ boolean PTR_ShootTraverse (intercept_t* in) dist = FixedMul (attackrange, in->frac); - // Check if backsector is NULL. See comment in PTR_AimTraverse. + // e6y: emulation of missed back side on two-sided lines. + // backsector can be NULL when emulating missing back side. - if (li->backsector == NULL) + if (li->backsector == NULL) { - goto hitline; - } + slope = FixedDiv (openbottom - shootz , dist); + if (slope > aimslope) + goto hitline; - if (li->frontsector->floorheight != li->backsector->floorheight) - { - slope = FixedDiv (openbottom - shootz , dist); - if (slope > aimslope) - goto hitline; - } - - if (li->frontsector->ceilingheight != li->backsector->ceilingheight) - { - slope = FixedDiv (opentop - shootz , dist); - if (slope < aimslope) - goto hitline; - } + slope = FixedDiv (opentop - shootz , dist); + if (slope < aimslope) + goto hitline; + } + else + { + if (li->frontsector->floorheight != li->backsector->floorheight) + { + slope = FixedDiv (openbottom - shootz , dist); + if (slope > aimslope) + goto hitline; + } + + if (li->frontsector->ceilingheight != li->backsector->ceilingheight) + { + slope = FixedDiv (opentop - shootz , dist); + if (slope < aimslope) + goto hitline; + } + } // shot continues return true; |