From 44abf5f8ea716bd6d3b85a8f31173b1ae24e84ab Mon Sep 17 00:00:00 2001 From: Marisa Kirisame Date: Fri, 26 Mar 2021 03:21:12 +0100 Subject: [PATCH] Boy I sure love gross hacks to work around scope fuckery. --- language.version | 4 +- zscript/weapons/swwm_thiccboolet.zsc | 79 ++++++++++++++++++---------- 2 files changed, 53 insertions(+), 30 deletions(-) diff --git a/language.version b/language.version index 67dfe3dd5..57d00fda5 100644 --- a/language.version +++ b/language.version @@ -1,3 +1,3 @@ [default] -SWWM_MODVER="\chSWWM \czGZ\c- \cw0.9.11b-pre r412 \cu(Fri 26 Mar 02:47:54 CET 2021)\c-"; -SWWM_SHORTVER="\cw0.9.11b-pre r412 \cu(2021-03-26 02:47:54)\c-"; +SWWM_MODVER="\chSWWM \czGZ\c- \cw0.9.11b-pre r413 \cu(Fri 26 Mar 03:21:12 CET 2021)\c-"; +SWWM_SHORTVER="\cw0.9.11b-pre r413 \cu(2021-03-26 03:21:12)\c-"; diff --git a/zscript/weapons/swwm_thiccboolet.zsc b/zscript/weapons/swwm_thiccboolet.zsc index ab576d2e8..db567fdcb 100644 --- a/zscript/weapons/swwm_thiccboolet.zsc +++ b/zscript/weapons/swwm_thiccboolet.zsc @@ -31,6 +31,7 @@ Class SilverBulletTracer : SpreadSlugTracer bool pastwall, fullstop; Array WallPenetrateList; Vector3 exitpoint; + transient Array ffloors; // needs to be done like this because HAHA SCOPE override ETraceStatus TraceCallback() { @@ -93,11 +94,24 @@ Class SilverBulletTracer : SpreadSlugTracer if ( (Results.Tier == TIER_Middle) && Results.HitLine.sidedef[1] && !(Results.HitLine.Flags&(Line.ML_BlockHitscan|Line.ML_BlockEverything)) ) return TRACE_Skip; } - for ( int i=1; i maxz) ) continue; + stop3d = true; + break; + } + if ( stop3d ) continue; let wp = new("WallPenetrate"); wp.hittype = Results.HitType; wp.hitline = Results.HitLine; @@ -125,35 +139,33 @@ Class SilverBulletTracer : SpreadSlugTracer penetration = max(0,penetration-i*4); // trace backwards to find exit surface let at = new("AuxiliarySilverBulletTracer"); - at.Trace(ofs,level.PointInSector(ofs.xy),-Results.HitVector,2.,TRACE_NoSky); - if ( at.Results.HitType != TRACE_HitNone ) + at.Trace(ofs,level.PointInSector(ofs.xy),-Results.HitVector,2.,0); + let wp2 = new("WallPenetrate"); + wp2.hittype = at.Results.HitType; + wp2.hitline = at.Results.HitLine; + wp2.hitside = at.Results.Side; + wp2.hittier = at.Results.Tier; + wp2.hitsector = at.Results.HitSector; + wp2.hitffloor = at.Results.ffloor; + wp2.hitside = at.Results.Side; + wp2.hitpos = at.Results.HitPos; + wp2.hitdir = at.Results.HitVector; + wp2.bustdir = -at.Results.HitVector; + wp2.penetration = int(penetration); + if ( at.Results.HitType == TRACE_HitWall ) { - let wp2 = new("WallPenetrate"); - wp2.hittype = at.Results.HitType; - wp2.hitline = at.Results.HitLine; - wp2.hitside = at.Results.Side; - wp2.hittier = at.Results.Tier; - wp2.hitsector = at.Results.HitSector; - wp2.hitffloor = at.Results.ffloor; - wp2.hitside = at.Results.Side; - wp2.hitpos = at.Results.HitPos; - wp2.hitdir = at.Results.HitVector; - wp2.bustdir = -at.Results.HitVector; - wp2.penetration = int(penetration); - if ( at.Results.HitType == TRACE_HitWall ) - { - wp2.hitnormal = (-at.Results.HitLine.delta.y,at.Results.HitLine.delta.x,0).unit(); - if ( !at.Results.Side ) wp2.hitnormal *= -1; - if ( at.Results.HitLine.sidedef[1] ) - ShootThroughList.Push(at.Results.HitLine); - } - else if ( at.Results.HitType == TRACE_HitCeiling ) - wp2.hitnormal = at.Results.HitSector.ceilingplane.Normal; - else if ( at.Results.HitType == TRACE_HitFloor ) - wp2.hitnormal = at.Results.HitSector.floorplane.Normal; - wp2.pastwall = pastwall; - WallPenetrateList.Push(wp2); + wp2.hitnormal = (-at.Results.HitLine.delta.y,at.Results.HitLine.delta.x,0).unit(); + if ( !at.Results.Side ) wp2.hitnormal *= -1; + if ( at.Results.HitLine.sidedef[1] ) + ShootThroughList.Push(at.Results.HitLine); } + else if ( at.Results.HitType == TRACE_HitCeiling ) + wp2.hitnormal = at.Results.HitSector.ceilingplane.Normal; + else if ( at.Results.HitType == TRACE_HitFloor ) + wp2.hitnormal = at.Results.HitSector.floorplane.Normal; + else wp2.hitnormal = wp2.hitdir; + wp2.pastwall = pastwall; + WallPenetrateList.Push(wp2); fullstop = false; exitpoint = ofs; return TRACE_Stop; @@ -650,6 +662,17 @@ Class SilverBullet : SWWMWeapon sst.shootthroughlist.Clear(); sst.waterhitlist.Clear(); sst.wallpenetratelist.Clear(); + sst.ffloors.Clear(); + for ( int i=0; i