diff --git a/cl_dll/hl/hl_weapons.cpp b/cl_dll/hl/hl_weapons.cpp index 9d1ea8a..84dfea4 100644 --- a/cl_dll/hl/hl_weapons.cpp +++ b/cl_dll/hl/hl_weapons.cpp @@ -835,9 +835,9 @@ void HUD_WeaponsPostThink(local_state_s* from, local_state_s* to, usercmd_t* cmd pto->m_fNextAimBonus = -1.0; } - if (pto->m_flNextPrimaryAttack < -1.1) + if (pto->m_flNextPrimaryAttack < -1.0) { - pto->m_flNextPrimaryAttack = -1.1; + pto->m_flNextPrimaryAttack = -1.0; } if (pto->m_flNextSecondaryAttack < -0.001) diff --git a/dlls/client.cpp b/dlls/client.cpp index e13b42c..62b8189 100644 --- a/dlls/client.cpp +++ b/dlls/client.cpp @@ -1772,12 +1772,12 @@ int GetWeaponData(struct edict_s* player, struct weapon_data_s* info) item->m_iId = II.iId; item->m_iClip = gun->m_iClip; - item->m_flTimeWeaponIdle = V_max(gun->m_flTimeWeaponIdle, -0.001); - item->m_flNextPrimaryAttack = V_max(gun->m_flNextPrimaryAttack, -0.001); - item->m_flNextSecondaryAttack = V_max(gun->m_flNextSecondaryAttack, -0.001); + item->m_flTimeWeaponIdle = V_max(gun->m_flTimeWeaponIdle, -0.001f); + item->m_flNextPrimaryAttack = V_max(gun->m_flNextPrimaryAttack, -0.001f); + item->m_flNextSecondaryAttack = V_max(gun->m_flNextSecondaryAttack, -0.001f); item->m_fInReload = static_cast(gun->m_fInReload); item->m_fInSpecialReload = gun->m_fInSpecialReload; - item->fuser1 = V_max(gun->pev->fuser1, -0.001); + item->fuser1 = V_max(gun->pev->fuser1, -0.001f); item->fuser2 = gun->m_flStartThrow; item->fuser3 = gun->m_flReleaseThrow; item->iuser1 = gun->m_chargeReady; @@ -1786,7 +1786,7 @@ int GetWeaponData(struct edict_s* player, struct weapon_data_s* info) gun->GetWeaponData(*item); - // item->m_flPumpTime = V_max( gun->m_flPumpTime, -0.001 ); + // item->m_flPumpTime = V_max( gun->m_flPumpTime, -0.001f ); } } pPlayerItem = pPlayerItem->m_pNext; diff --git a/dlls/crowbar.cpp b/dlls/crowbar.cpp index 806999c..9c57500 100644 --- a/dlls/crowbar.cpp +++ b/dlls/crowbar.cpp @@ -222,7 +222,9 @@ bool CCrowbar::Swing(bool fFirst) ClearMultiDamage(); - if ((m_flNextPrimaryAttack + 1 < UTIL_WeaponTimeBase()) || g_pGameRules->IsMultiplayer()) + // JoshA: Changed from < -> <= to fix the full swing logic since client weapon prediction. + // -1.0f + 1.0f = 0.0f. UTIL_WeaponTimeBase is always 0 with client weapon prediction (0 time base vs curtime base) + if ((m_flNextPrimaryAttack + 1.0f <= UTIL_WeaponTimeBase()) || g_pGameRules->IsMultiplayer()) { // first swing does full damage pEntity->TraceAttack(m_pPlayer->pev, gSkillData.plrDmgCrowbar, gpGlobals->v_forward, &tr, DMG_CLUB); diff --git a/dlls/player.cpp b/dlls/player.cpp index 3ff712c..59cef2e 100644 --- a/dlls/player.cpp +++ b/dlls/player.cpp @@ -2621,17 +2621,17 @@ pt_end: if (gun && gun->UseDecrement()) { - gun->m_flNextPrimaryAttack = V_max(gun->m_flNextPrimaryAttack - gpGlobals->frametime, -1.1); - gun->m_flNextSecondaryAttack = V_max(gun->m_flNextSecondaryAttack - gpGlobals->frametime, -0.001); + gun->m_flNextPrimaryAttack = V_max(gun->m_flNextPrimaryAttack - gpGlobals->frametime, -1.0f); + gun->m_flNextSecondaryAttack = V_max(gun->m_flNextSecondaryAttack - gpGlobals->frametime, -0.001f); if (gun->m_flTimeWeaponIdle != 1000) { - gun->m_flTimeWeaponIdle = V_max(gun->m_flTimeWeaponIdle - gpGlobals->frametime, -0.001); + gun->m_flTimeWeaponIdle = V_max(gun->m_flTimeWeaponIdle - gpGlobals->frametime, -0.001f); } if (gun->pev->fuser1 != 1000) { - gun->pev->fuser1 = V_max(gun->pev->fuser1 - gpGlobals->frametime, -0.001); + gun->pev->fuser1 = V_max(gun->pev->fuser1 - gpGlobals->frametime, -0.001f); } gun->DecrementTimers(); diff --git a/dlls/weapons.cpp b/dlls/weapons.cpp index 7316742..ca2a770 100644 --- a/dlls/weapons.cpp +++ b/dlls/weapons.cpp @@ -1013,7 +1013,7 @@ void CBasePlayerWeapon::DoRetireWeapon() //========================================================================= float CBasePlayerWeapon::GetNextAttackDelay(float delay) { - if (m_flLastFireTime == 0 || m_flNextPrimaryAttack <= -1.1) + if (m_flLastFireTime == 0 || m_flNextPrimaryAttack == -1) { // At this point, we are assuming that the client has stopped firing // and we are going to reset our book keeping variables.