diff --git a/source/server/weapons/weapon_core.qc b/source/server/weapons/weapon_core.qc index 7937b2d..d73421f 100644 --- a/source/server/weapons/weapon_core.qc +++ b/source/server/weapons/weapon_core.qc @@ -454,6 +454,9 @@ void(float side) W_Reload = delay = getWeaponDelay(self.weapon,RELOAD); void(optional float t) endanimfunc = SUB_Null; + if (!reloadcancelframe) + reloadcancelframe = endframe; + if (self.weapon == W_KAR_SCOPE || self.weapon == W_HEADCRACKER ){ startframe = 14; endframe = 18; @@ -497,6 +500,17 @@ void(float side) W_Reload = } else { self.reload_delay2 = delay + time; } + + // Sometimes we hit a race condition of sorts where if we have a weapon + // designed not to fill the magazine until the end of the reload, + // reload_delay is improperly zero because of server tick rate. + // Firing while this occurs causes the reload to cancel and the mag to not + // fill. So we delay when we can action again to ensure we reach the mag + // fill state. -- cypress (30 Nov 2024) + if (endframe == reloadcancelframe) { + self.reload_delay += 0.5; + self.reload_delay2 += 0.5; + } Set_W_Frame (startframe, endframe, delay, reloadcancelframe, RELOAD, endanimfunc, modelname, false, side, false); } diff --git a/source/shared/weapon_stats.qc b/source/shared/weapon_stats.qc index dfd51ac..b4f69c4 100644 --- a/source/shared/weapon_stats.qc +++ b/source/shared/weapon_stats.qc @@ -2394,8 +2394,6 @@ float(float wep, float frametype, optional float z) GetFrame = return 50; case PUT_OUT_END: return 53; - case RELOAD_CANCEL: - return 48; } break; case W_STG: