- 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.
This commit is contained in:
Christoph Oelckers 2016-06-13 21:30:58 +02:00
parent 82bc5e7bd1
commit f1597a5d26

View file

@ -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.