From e81641dd014c26ce030f52a6d7f05e68fde698c0 Mon Sep 17 00:00:00 2001 From: Marisa Kirisame Date: Sun, 7 Jun 2020 11:51:59 +0200 Subject: [PATCH] Hotfix: LineTrace now reports the correct number of portal crossings. --- src/playsim/p_map.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/playsim/p_map.cpp b/src/playsim/p_map.cpp index 5a4593bd6..450f09d5c 100644 --- a/src/playsim/p_map.cpp +++ b/src/playsim/p_map.cpp @@ -4866,7 +4866,8 @@ int P_LineTrace(AActor *t1, DAngle angle, double distance, outdata->HitLocation = trace.HitPos; outdata->HitDir = trace.HitVector; outdata->Distance = trace.Distance; - outdata->NumPortals = TData.NumPortals; + // [MK] Subtract two "bogus" portal crossings used internally by trace code + outdata->NumPortals = TData.NumPortals-2; outdata->HitType = trace.HitType; } return ret;