Fix incorrect HitTexture reassignment in LineTrace.

This commit is contained in:
Marisa Kirisame 2018-01-28 14:23:50 +01:00 committed by Christoph Oelckers
parent 5d223bb8c3
commit bc4a8190bf

View file

@ -4902,17 +4902,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 )
@ -4934,9 +4925,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;