diff --git a/binary/dlls/client.cpp b/binary/dlls/client.cpp index 6c2461ca..7d8bac6c 100644 --- a/binary/dlls/client.cpp +++ b/binary/dlls/client.cpp @@ -1686,12 +1686,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 = 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; diff --git a/binary/dlls/crowbar.cpp b/binary/dlls/crowbar.cpp index 216c56dc..6ce08ad9 100644 --- a/binary/dlls/crowbar.cpp +++ b/binary/dlls/crowbar.cpp @@ -264,6 +264,10 @@ int CCrowbar::Swing( int fFirst ) ClearMultiDamage( ); + // 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()) + pEntity->TraceAttack(m_pPlayer->pev, gSkillData.plrDmgCrowbar, gpGlobals->v_forward, &tr, DMG_CLUB ); ApplyMultiDamage( m_pPlayer->pev, m_pPlayer->pev ); diff --git a/binary/dlls/func_break.cpp b/binary/dlls/func_break.cpp index e6c8b776..5205b2ac 100644 --- a/binary/dlls/func_break.cpp +++ b/binary/dlls/func_break.cpp @@ -935,9 +935,14 @@ void CPushable :: Move( CBaseEntity *pOther, int push ) if ( pOther->IsPlayer() ) { - if ( push && !(pevToucher->button & (IN_FORWARD|IN_USE)) ) // Don't push unless the player is pushing forward and NOT use (pull) + // JoshA: Used to check for FORWARD too and logic was inverted + // from comment which seems wrong. + // Fixed to just check for USE being not set for PUSH. + // Should have the right effect. + if (push && !!(pevToucher->button & IN_USE)) // Don't push unless the player is not useing (pull) return; - playerTouch = 1; + + playerTouch = true; } float factor; @@ -957,20 +962,35 @@ void CPushable :: Move( CBaseEntity *pOther, int push ) else factor = 0.25; - pev->velocity.x += pevToucher->velocity.x * factor; - pev->velocity.y += pevToucher->velocity.y * factor; - + // This used to be added every 'frame', but to be consistent at high fps, + // now act as if it's added at a constant rate with a fudge factor. + extern cvar_t sv_pushable_fixed_tick_fudge; + if (!push && sv_pushable_fixed_tick_fudge.value >= 0.0f) + { + factor *= gpGlobals->frametime * sv_pushable_fixed_tick_fudge.value; + } + // JoshA: Always apply this if pushing, or if under the player's velocity. + if (push || (abs(pev->velocity.x) < abs(pevToucher->velocity.x - pevToucher->velocity.x * factor))) + pev->velocity.x += pevToucher->velocity.x * factor; + if (push || (abs(pev->velocity.y) < abs(pevToucher->velocity.y - pevToucher->velocity.y * factor))) + pev->velocity.y += pevToucher->velocity.y * factor; float length = sqrt( pev->velocity.x * pev->velocity.x + pev->velocity.y * pev->velocity.y ); - if ( push && (length > MaxSpeed()) ) + if ( length > MaxSpeed() ) { pev->velocity.x = (pev->velocity.x * MaxSpeed() / length ); pev->velocity.y = (pev->velocity.y * MaxSpeed() / length ); } if ( playerTouch ) { - pevToucher->velocity.x = pev->velocity.x; - pevToucher->velocity.y = pev->velocity.y; - if ( (gpGlobals->time - m_soundTime) > 0.7 ) + // JoshA: Match the player to our pushable's velocity. + // Previously this always happened, but it should only + // happen if the player is pushing (or rather, being pushed.) + // This either stops the player in their tracks or nudges them along. + if (push) + { + pevToucher->velocity.x = pev->velocity.x; + pevToucher->velocity.y = pev->velocity.y; + } if ( (gpGlobals->time - m_soundTime) > 0.7 ) { m_soundTime = gpGlobals->time; if ( length > 0 && FBitSet(pev->flags,FL_ONGROUND) ) diff --git a/binary/dlls/game.cpp b/binary/dlls/game.cpp index 54942b6e..e1d1bc47 100644 --- a/binary/dlls/game.cpp +++ b/binary/dlls/game.cpp @@ -606,6 +606,8 @@ cvar_t sv_aura_regeneration_wait = { "sv_aura_regeneration_wait", "0.03", FCVAR_ // END Cvars for Skill Level settings +cvar_t sv_pushable_fixed_tick_fudge = { "sv_pushable_fixed_tick_fudge", "15" }; + // Register your console variables here // This gets called one time when the game is initialied void GameDLLInit( void ) @@ -1169,7 +1171,8 @@ void GameDLLInit( void ) CVAR_REGISTER(&sv_aura_regeneration_wait); // END REGISTER CVARS FOR SKILL LEVEL STUFF -// + + CVAR_REGISTER(&sv_pushable_fixed_tick_fudge); //++ BulliT AgInitGame(); diff --git a/binary/dlls/gauss.cpp b/binary/dlls/gauss.cpp index c11aefc7..11e14ff7 100644 --- a/binary/dlls/gauss.cpp +++ b/binary/dlls/gauss.cpp @@ -426,6 +426,13 @@ void CGauss::Fire(Vector vecOrigSrc, Vector vecDir, float flDamage) if (pEntity->pev->takedamage) { ClearMultiDamage(); + + // if you hurt yourself clear the headshot bit + if (m_pPlayer->pev == pEntity->pev) + { + tr.iHitgroup = 0; + } + pEntity->TraceAttack(m_pPlayer->pev, flDamage, vecDir, &tr, DMG_BULLET); ApplyMultiDamage(m_pPlayer->pev, m_pPlayer->pev); } diff --git a/binary/dlls/player.cpp b/binary/dlls/player.cpp index 9245fc9e..95cbd591 100644 --- a/binary/dlls/player.cpp +++ b/binary/dlls/player.cpp @@ -3188,17 +3188,17 @@ void CBasePlayer::PostThink() if ( gun && gun->UseDecrement() ) { - gun->m_flNextPrimaryAttack = V_max( gun->m_flNextPrimaryAttack - gpGlobals->frametime, -1.0 ); - 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 ); } // Only decrement if not flagged as NO_DECREMENT diff --git a/binary/pm_shared/pm_shared.cpp b/binary/pm_shared/pm_shared.cpp index ed1fbb3f..e8d78ac4 100644 --- a/binary/pm_shared/pm_shared.cpp +++ b/binary/pm_shared/pm_shared.cpp @@ -2859,6 +2859,15 @@ void PM_CheckParamters( void ) pmove->maxspeed = V_min( maxspeed, pmove->maxspeed ); } + // Slow down, I'm pulling it! (a box maybe) but only when I'm standing on ground + // + // JoshA: Moved this to CheckParamters rather than working on the velocity, + // as otherwise it affects every integration step incorrectly. + if ((pmove->onground != -1) && (pmove->cmd.buttons & IN_USE)) + { + pmove->maxspeed *= 1.0f / 3.0f; + } + if ( ( spd != 0.0 ) && ( spd > pmove->maxspeed ) ) { @@ -3031,14 +3040,6 @@ void PM_PlayerMove ( qboolean server ) } } -#if !defined( _TFC ) - // Slow down, I'm pulling it! (a box maybe) but only when I'm standing on ground - if ( ( pmove->onground != -1 ) && ( pmove->cmd.buttons & IN_USE) ) - { - VectorScale( pmove->velocity, 0.3, pmove->velocity ); - } -#endif - // Handle movement switch ( pmove->movetype ) {