Fix incorrect HitTexture reassignment in LineTrace.

This commit is contained in:
Marisa Kirisame 2018-01-28 14:23:50 +01:00
parent d207f426c1
commit 0181f3195c

View file

@ -4898,17 +4898,8 @@ bool P_LineTrace(AActor *t1, DAngle angle, double distance,
outdata->HitLine = trace.Line;
outdata->HitSector = trace.Sector;
outdata->Hit3DFloor = trace.ffloor;
switch ( trace.HitType )
if ( trace.HitType == TRACE_HitWall )
{
case TRACE_HitFloor:
outdata->SectorPlane = 0;
outdata->HitTexture = trace.Sector->planes[0].Texture;
break;
case TRACE_HitCeiling:
outdata->SectorPlane = 1;
outdata->HitTexture = trace.Sector->planes[1].Texture;
break;
case TRACE_HitWall:
outdata->LineSide = trace.Side;
int txpart;
switch ( trace.Tier )
@ -4930,9 +4921,8 @@ bool P_LineTrace(AActor *t1, DAngle angle, double distance,
outdata->HitTexture = trace.ffloor->master->sidedef[0]->textures[txpart].texture;
break;
}
default:
break;
}
else outdata->HitTexture = trace.HitTexture;
outdata->HitLocation = trace.HitPos;
outdata->Distance = trace.Distance;
outdata->NumPortals = TData.NumPortals;