| # | Line 252 | Line 252 | compute_worldpos(FVECT wpos, DEPTHCODEC *dcp, int x, i | |
|---|---|---|
| 252 | RREAL loc[2]; | |
| 253 | FVECT rdir; | |
| 254 | ||
| 255 | + | if (d >= FHUGE*.99) |
| 256 | + | goto badval; |
| 257 | + | |
| 258 | pix2loc(loc, &dcp->res, x, y); | |
| 259 | ||
| 260 | < | if (viewray(wpos, rdir, &dcp->vw, loc[0], loc[1]) < -FTINY) { |
| 261 | < | VCOPY(wpos, dcp->vw.vp); |
| 262 | < | return 0; |
| 260 | > | if (viewray(wpos, rdir, &dcp->vw, loc[0], loc[1]) >= -FTINY) { |
| 261 | > | VSUM(wpos, wpos, rdir, d); |
| 262 | > | return 1; |
| 263 | } | |
| 264 | < | VSUM(wpos, wpos, rdir, d); |
| 265 | < | return 1; |
| 264 | > | badval: |
| 265 | > | VCOPY(wpos, dcp->vw.vp); |
| 266 | > | return 0; |
| 267 | } | |
| 268 | ||
| 269 | ||
| – | Removed lines |
| + | Added lines |
| < | Changed lines |
| > | Changed lines |