Skip to content

Commit

Permalink
Fixed: Enhanced missing Material selection algorithm to not pic the s…
Browse files Browse the repository at this point in the history
…ubsitute from an adjacent Surface if the back height is considered "closed" (fixes teleport flat on the side of the secret teleporter in DOOM2::MAP04).
  • Loading branch information
danij-deng committed Jul 24, 2010
1 parent bc65660 commit 2ab61a5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion doomsday/engine/portable/src/r_world.c
Expand Up @@ -1651,7 +1651,8 @@ static material_t* chooseFixMaterial(sidedef_t* s, segsection_t section)
sector_t* backSec = s->line->L_sector(sid^1);
surface_t* suf;

if(backSec)
if(backSec && ((section == SEG_BOTTOM && frontSec->SP_floorheight < backSec->SP_floorheight && frontSec->SP_ceilheight > backSec->SP_floorheight)) ||
(section == SEG_TOP && frontSec->SP_ceilheight > backSec->SP_ceilheight && frontSec->SP_floorheight < backSec->SP_ceilheight))
{
suf = &backSec->SP_plane(section == SEG_BOTTOM? PLN_FLOOR : PLN_CEILING)->surface;
if(suf->material && !R_IsSkySurface(suf))
Expand Down

0 comments on commit 2ab61a5

Please sign in to comment.