From 206120f01e376caca768749a338c8f322e332d2f Mon Sep 17 00:00:00 2001 From: cypress Date: Mon, 23 Oct 2023 16:51:15 -0400 Subject: [PATCH] SERVER: Better support for hiding crosshair during dual reload --- source/server/weapons/frames_core.qc | 4 +++- source/server/weapons/weapon_core.qc | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/source/server/weapons/frames_core.qc b/source/server/weapons/frames_core.qc index 3947c10..587c028 100644 --- a/source/server/weapons/frames_core.qc +++ b/source/server/weapons/frames_core.qc @@ -93,6 +93,8 @@ void () W2_Frame_Update = } else { + if (self.callfuncat2 != self.weapon2frame && self.reload_delay <= time) + W_ShowCrosshair(self); self.weapon2frame = self.weapon2frame_end = self.weapon2frame = GetFrame(self.weapon,BASE_FRAME); self.new_anim2_stop = FALSE; self.weapon2_anim_type = 0; @@ -159,7 +161,7 @@ void () W_Frame_Update = } else { - if (self.callfuncat != self.weaponframe) + if (self.callfuncat != self.weaponframe && self.reload_delay2 <= time) W_ShowCrosshair(self); self.weaponframe_end = self.weaponframe = GetFrame(self.weapon,BASE_FRAME); self.new_anim_stop = FALSE; diff --git a/source/server/weapons/weapon_core.qc b/source/server/weapons/weapon_core.qc index 69e79af..7e05048 100644 --- a/source/server/weapons/weapon_core.qc +++ b/source/server/weapons/weapon_core.qc @@ -411,7 +411,11 @@ void(float side) W_Reload = W_AimOut(); W_SprintStop(); - W_HideCrosshair(self); + + // If it's a dual wielded weapon, we don't want to hide the crosshair + // unless both weapons are being reloaded. + if (!IsDualWeapon(self.weapon) || (self.reload_delay > time || self.reload_delay2 > time)) + W_HideCrosshair(self); float endframe, startframe, reloadcancelframe, delay; string modelname = "";