PolyObject: Allow translucency to be set via X offset

This commit is contained in:
MascaraSnake 2020-05-04 19:47:39 +02:00
parent 248df41a2f
commit de100b076a
1 changed files with 5 additions and 1 deletions

View File

@ -217,7 +217,11 @@ static void Polyobj_GetInfo(polyobj_t *po)
if (po->parent == po->id) // do not allow a self-reference
po->parent = -1;
po->translucency = (lines[i].frontsector->floorheight>>FRACBITS) / 100;
po->translucency = (lines[i].flags & ML_DONTPEGTOP)
? (sides[lines[i].sidenum[0]].textureoffset>>FRACBITS)
: ((lines[i].frontsector->floorheight>>FRACBITS) / 100);
po->translucency = max(min(po->translucency, NUMTRANSMAPS), 0);
po->flags = POF_SOLID|POF_TESTHEIGHT|POF_RENDERSIDES;