Fix incorrect underwater detection.

This commit is contained in:
Mari the Deer 2022-05-08 23:20:34 +02:00
commit bb9e37d7f3
2 changed files with 4 additions and 4 deletions

View file

@ -1,3 +1,3 @@
[default]
SWWM_MODVER="\cyDEMOLITIONIST \cw1.2.18 \cu(Sun 8 May 23:23:41 CEST 2022)\c-";
SWWM_SHORTVER="\cw1.2.18 \cu(2022-05-08 23:23:41)\c-";
SWWM_MODVER="\cyDEMOLITIONIST \cw1.2.18 r1 \cu(Sun 8 May 23:23:54 CEST 2022)\c-";
SWWM_SHORTVER="\cw1.2.18 r1 \cu(2022-05-08 23:23:54)\c-";

View file

@ -749,7 +749,7 @@ Class Demolitionist : PlayerPawn
Sector headregion = null;
if ( CurSector.moreflags&Sector.SECMF_UNDERWATER ) // check underwater sector
headregion = CurSector;
else if ( CurSector.heightsec && (Cursector.heightsec.moreflags&Sector.SECMF_UNDERWATER) ) // check height transfer
else if ( CurSector.heightsec && (Cursector.heightsec.moreflags&Sector.SECMF_UNDERWATERMASK) ) // check height transfer
{
let hsec = CurSector.heightsec;
double fh = hsec.floorplane.ZAtPoint(pos.xy);
@ -766,7 +766,7 @@ Class Demolitionist : PlayerPawn
for ( int i=0; i<CurSector.Get3DFloorCount(); i++ )
{
let ff = CurSector.Get3DFloor(i);
if ( !(ff.flags&F3DFloor.FF_EXISTS) || (ff.flags&F3DFloor.FF_SOLID) || (!(ff.flags&F3DFloor.FF_SWIMMABLE) && (ff.alpha == 0)) ) continue;
if ( !(ff.flags&F3DFloor.FF_EXISTS) || (ff.flags&F3DFloor.FF_SOLID) || !(ff.flags&F3DFloor.FF_SWIMMABLE) ) continue;
double ff_bottom = ff.bottom.ZAtPoint(pos.xy);
double ff_top = ff.top.ZAtPoint(pos.xy);
if ( (ff_top <= pos.z) || (ff_bottom > centerpos.z) ) continue;