diff --git a/language.version b/language.version index 953134eb0..238ebd633 100644 --- a/language.version +++ b/language.version @@ -1,3 +1,3 @@ [default] -SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r605 \cu(Wed 9 Nov 12:33:43 CET 2022)\c-"; -SWWM_SHORTVER="\cw1.3pre r605 \cu(2022-11-09 12:33:43)\c-"; +SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r606 \cu(Fri 11 Nov 00:08:54 CET 2022)\c-"; +SWWM_SHORTVER="\cw1.3pre r606 \cu(2022-11-11 00:08:54)\c-"; diff --git a/zscript/handler/swwm_handler_crosshair.zsc b/zscript/handler/swwm_handler_crosshair.zsc index 0d367c93c..3daec2255 100644 --- a/zscript/handler/swwm_handler_crosshair.zsc +++ b/zscript/handler/swwm_handler_crosshair.zsc @@ -111,6 +111,8 @@ extend Class SWWMHandler double theta = clamp(15.*frametime,0.,.5); // naive, but whatever // draw precise crosshair(s) if ( automapactive || (players[consoleplayer].Camera != players[consoleplayer].mo) || (players[consoleplayer].cheats&CF_CHASECAM) || (numcrosshairs <= 0) ) return; + let sw = SWWMWeapon(players[consoleplayer].ReadyWeapon); + if ( sw && !sw.ShouldDrawCrosshair() ) return; if ( !swwm_precisecrosshair ) return; if ( crosshairforce ) return; if ( !crosshairon && (swwm_precisecrosshair <= 1) ) return; diff --git a/zscript/weapons/swwm_baseweapon_precisechair.zsc b/zscript/weapons/swwm_baseweapon_precisechair.zsc index 05b35d974..5d1bab376 100644 --- a/zscript/weapons/swwm_baseweapon_precisechair.zsc +++ b/zscript/weapons/swwm_baseweapon_precisechair.zsc @@ -17,7 +17,7 @@ extend Class SWWMWeapon // force custom crosshair if ( swwm_precisecrosshair && (players[consoleplayer].Camera == players[consoleplayer].mo) && !(players[consoleplayer].cheats&CF_CHASECAM) ) crosshair = 99; - else crosshair = 0; + else crosshair = ShouldDrawCrosshair()?0:99; } // where the trace is coming from relative to eyes @@ -25,4 +25,10 @@ extend Class SWWMWeapon { return (0.,0.,0.); } + + // should we draw the crosshair? (for scoped weapons) + virtual clearscope bool ShouldDrawCrosshair() const + { + return true; + } } diff --git a/zscript/weapons/swwm_thiccboolet.zsc b/zscript/weapons/swwm_thiccboolet.zsc index b45e4192f..acb06b12c 100644 --- a/zscript/weapons/swwm_thiccboolet.zsc +++ b/zscript/weapons/swwm_thiccboolet.zsc @@ -238,7 +238,6 @@ Class SilverBullet : SWWMWeapon override void DoEffect() { Super.DoEffect(); - if ( zoomed ) crosshair = 99; if ( !Owner || !Owner.player ) { proneme = false; @@ -281,6 +280,10 @@ Class SilverBullet : SWWMWeapon else PPShader.SetEnabled("SilverScope",false); Super.RenderUnderlay(e); } + override bool ShouldDrawCrosshair() + { + return !zoomed; + } action void ProcessTraceHit( SilverBulletTracer t, Vector3 origin, Vector3 dir ) {