diff options
author | Simon Howard | 2010-02-05 23:08:12 +0000 |
---|---|---|
committer | Simon Howard | 2010-02-05 23:08:12 +0000 |
commit | 677729c658b39f075e563fbc9f5a898641f7de54 (patch) | |
tree | 109bae4ac22fbc6f8a34ba34a4e9fc6a33e75c48 /src/doom/p_map.c | |
parent | 8a77b34e936a3fd752db3bc1113e3d7bd0555440 (diff) | |
parent | b4f2d75b34b6e2b9bbb2fa6449125d3446a93a73 (diff) | |
download | chocolate-doom-677729c658b39f075e563fbc9f5a898641f7de54.tar.gz chocolate-doom-677729c658b39f075e563fbc9f5a898641f7de54.tar.bz2 chocolate-doom-677729c658b39f075e563fbc9f5a898641f7de54.zip |
Merge from trunk.
Subversion-branch: /branches/raven-branch
Subversion-revision: 1845
Diffstat (limited to 'src/doom/p_map.c')
-rw-r--r-- | src/doom/p_map.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/doom/p_map.c b/src/doom/p_map.c index 3f88aabc..925e4398 100644 --- a/src/doom/p_map.c +++ b/src/doom/p_map.c @@ -885,7 +885,17 @@ PTR_AimTraverse (intercept_t* in) dist = FixedMul (attackrange, in->frac); - if (li->frontsector->floorheight != li->backsector->floorheight) + // 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) { slope = FixedDiv (openbottom - shootz , dist); if (slope > bottomslope) @@ -973,7 +983,14 @@ boolean PTR_ShootTraverse (intercept_t* in) dist = FixedMul (attackrange, in->frac); - if (li->frontsector->floorheight != li->backsector->floorheight) + // Check if backsector is NULL. See comment in PTR_AimTraverse. + + if (li->backsector == NULL) + { + goto hitline; + } + + if (li->frontsector->floorheight != li->backsector->floorheight) { slope = FixedDiv (openbottom - shootz , dist); if (slope > aimslope) |