From bc4a8190bfbbf64a8cf09a3b3fbcc573d0d933b6 Mon Sep 17 00:00:00 2001 From: Marisa Kirisame Date: Sun, 28 Jan 2018 14:23:50 +0100 Subject: [PATCH] Fix incorrect HitTexture reassignment in LineTrace. --- src/p_map.cpp | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/p_map.cpp b/src/p_map.cpp index 16d8ac564b..6ead821baf 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -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;