From f1597a5d26b2263f55b1d4abd4f9ee40cf2d31f2 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 13 Jun 2016 21:30:58 +0200 Subject: [PATCH] - fixed: Trace should set CrossedWater only if a water surface actually is crossed, i.e. the start of the trace and the end of the trace are on different sides of the surface. This was incorrectly spawning splashes when shooting inside a deep water sector, but in most cases the splash just was not visible. It could become visible if its position got clipped by a nearby one-sided wall. --- src/p_trace.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/p_trace.cpp b/src/p_trace.cpp index 67a516f9c..16fff3fbe 100644 --- a/src/p_trace.cpp +++ b/src/p_trace.cpp @@ -434,7 +434,7 @@ bool FTraceInfo::LineCheck(intercept_t *in, double dist, DVector3 hit) sector_t *hsec = CurSector->GetHeightSec(); if (Results->CrossedWater == NULL && hsec != NULL && - //CurSector->heightsec->waterzone && + Start.Z > hsec->floorplane.ZatPoint(Start) && hit.Z <= hsec->floorplane.ZatPoint(hit)) { // hit crossed a water plane @@ -846,6 +846,7 @@ bool FTraceInfo::TraceTraverse (int ptflags) if (Results->CrossedWater == NULL && CurSector->heightsec != NULL && + CurSector->heightsec->floorplane.ZatPoint(Start) < Start.Z && CurSector->heightsec->floorplane.ZatPoint(Results->HitPos) >= Results->HitPos.Z) { // Save the result so that the water check doesn't destroy it.