Fix crosshair drawing for scoped weapons.
This commit is contained in:
parent
047946bb3d
commit
67a899aaa9
4 changed files with 15 additions and 4 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 )
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue