Fix incorrect underwater detection.

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

View file

@ -1,3 +1,3 @@
[default]
SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r61 \cu(Sun 8 May 18:43:42 CEST 2022)\c-";
SWWM_SHORTVER="\cw1.3pre r61 \cu(2022-05-08 18:43:42)\c-";
SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r62 \cu(Sun 8 May 23:20:34 CEST 2022)\c-";
SWWM_SHORTVER="\cw1.3pre r62 \cu(2022-05-08 23:20:34)\c-";

View file

@ -685,7 +685,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);
@ -702,7 +702,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;