- allow splashing on non-swimmable, non-solid 3D floors if they are marked liquid and have a splash assigned.

This commit is contained in:
Christoph Oelckers 2017-02-15 23:06:24 +01:00
parent 4df2a221a8
commit 304e989496

View file

@ -41,6 +41,7 @@
#include "r_defs.h"
#include "p_spec.h"
#include "g_levellocals.h"
#include "p_terrain.h"
//==========================================================================
//
@ -135,6 +136,13 @@ static void GetPortalTransition(DVector3 &pos, sector_t *&sec)
}
}
static bool isLiquid(F3DFloor *ff)
{
if (ff->flags & FF_SWIMMABLE) return true;
auto terrain = ff->model->GetTerrain(ff->flags & FF_INVERTPLANES ? sector_t::floor : sector_t::ceiling);
return Terrains[terrain].IsLiquid && Terrains[terrain].Splash != -1;
}
//==========================================================================
//
// Trace entry point
@ -300,9 +308,9 @@ void FTraceInfo::Setup3DFloors()
if (!(rover->flags&FF_EXISTS))
continue;
if (rover->flags&FF_SWIMMABLE && Results->Crossed3DWater == NULL)
if (Results->Crossed3DWater == NULL)
{
if (Check3DFloorPlane(rover, false))
if (Check3DFloorPlane(rover, false) && isLiquid(rover))
{
// only consider if the plane is above the actual floor.
if (rover->top.plane->ZatPoint(Results->HitPos) > bf)
@ -767,7 +775,7 @@ bool FTraceInfo::TraceTraverse (int ptflags)
{
for (auto rover : CurSector->e->XFloor.ffloors)
{
if ((rover->flags & FF_EXISTS) && (rover->flags&FF_SWIMMABLE))
if ((rover->flags & FF_EXISTS) && isLiquid(rover))
{
if (Check3DFloorPlane(rover, false))
{