Skip to content

Commit

Permalink
mbspc: less crude HL_FixContentsTextures: fixes tex alignment on liquids
Browse files Browse the repository at this point in the history
  • Loading branch information
Garux committed Dec 20, 2024
1 parent fbf88ec commit d6cbd7e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tools/mbspc/mbspc/map_hl.c
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,7 @@ void HL_FixContentsTextures(bspbrush_t *brushlist)
for (i = 0; i < brush->numsides; i++)
{
texinfonum = brush->sides[i].texinfo;
if (HL_TextureContents(map_texinfo[texinfonum].texture) == brush->side) break;
if (texinfonum >= 0 && HL_TextureContents(map_texinfo[texinfonum].texture) == brush->side) break;
} //end for
//if no specific contents texture was found
if (i >= brush->numsides)
Expand All @@ -917,10 +917,12 @@ void HL_FixContentsTextures(bspbrush_t *brushlist)
//
if (texinfonum >= 0)
{
//give all the brush sides this contents texture
//replace all non matching brush sides texinfos with this contents texture
for (i = 0; i < brush->numsides; i++)
{
brush->sides[i].texinfo = texinfonum;
const int ti = brush->sides[i].texinfo;
if(ti < 0 || HL_TextureContents(map_texinfo[ti].texture) != brush->side)
brush->sides[i].texinfo = texinfonum;
} //end for
} //end if
else Log_Print("brush contents %d with wrong textures\n", brush->side);
Expand Down

0 comments on commit d6cbd7e

Please sign in to comment.