From bd25ac0dfa024e7d573861cfc0dc75543e578d4c Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Sat, 21 Dec 2024 21:32:29 +0300 Subject: [PATCH 1/2] Don't pack satchel into weaponbox if all satchels were thrown. Fix #494 (#495) --- dlls/player.cpp | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/dlls/player.cpp b/dlls/player.cpp index aae7c7b00..f9a633da6 100644 --- a/dlls/player.cpp +++ b/dlls/player.cpp @@ -785,21 +785,35 @@ void CBasePlayer::PackDeadPlayerItems( void ) } else { - // pack the ammo - while( iPackAmmo[iPA] != -1 ) + bool bPackItems = true; + if ( iAmmoRules == GR_PLR_DROP_AMMO_ACTIVE && iWeaponRules == GR_PLR_DROP_GUN_ACTIVE ) { - pWeaponBox->PackAmmo( MAKE_STRING( CBasePlayerItem::AmmoInfoArray[iPackAmmo[iPA]].pszName ), m_rgAmmo[iPackAmmo[iPA]] ); - iPA++; + if ( rgpPackWeapons[0] == NULL + || ( FClassnameIs( rgpPackWeapons[0]->pev, "weapon_satchel" ) && ( iPackAmmo[0] == -1 || ( m_rgAmmo[iPackAmmo[0]] == 0 ) ) ) ) + { + bPackItems = false; + } } - // now pack all of the items in the lists - while( rgpPackWeapons[iPW] ) + if ( bPackItems ) { - // weapon unhooked from the player. Pack it into der box. - pWeaponBox->PackWeapon( rgpPackWeapons[iPW] ); + // pack the ammo + while( iPackAmmo[iPA] != -1 ) + { + pWeaponBox->PackAmmo( MAKE_STRING( CBasePlayerItem::AmmoInfoArray[iPackAmmo[iPA]].pszName ), m_rgAmmo[iPackAmmo[iPA]] ); + iPA++; + } - iPW++; + // now pack all of the items in the lists + while( rgpPackWeapons[iPW] ) + { + // weapon unhooked from the player. Pack it into der box. + pWeaponBox->PackWeapon( rgpPackWeapons[iPW] ); + + iPW++; + } } + pWeaponBox->pev->velocity = pev->velocity * 1.2f;// weaponbox has player's velocity, then some. } RemoveAllItems( TRUE );// now strip off everything that wasn't handled by the code above. From 810cd6042b4a82e31bc707f0efc8de548fa0d608 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Sat, 21 Dec 2024 21:32:41 +0300 Subject: [PATCH 2/2] client: register joysupported cvar to be able to use gamepads on HL25 (#496) --- cl_dll/input_goldsource.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cl_dll/input_goldsource.cpp b/cl_dll/input_goldsource.cpp index d3517b288..26567c0a6 100644 --- a/cl_dll/input_goldsource.cpp +++ b/cl_dll/input_goldsource.cpp @@ -1614,6 +1614,11 @@ void GoldSourceInput::IN_Init (void) joy_wwhack1 = gEngfuncs.pfnRegisterVariable ( "joywwhack1", "0.0", 0 ); joy_wwhack2 = gEngfuncs.pfnRegisterVariable ( "joywwhack2", "0.0", 0 ); + // HL25 checks this cvar and if it doesn't exist or set to zero + // it will lock any usage of gamepads + // see: https://github.com/ValveSoftware/halflife/issues/3621 + gEngfuncs.pfnRegisterVariable( "joysupported", "1", 0 ); + m_customaccel = gEngfuncs.pfnRegisterVariable ( "m_customaccel", "0", FCVAR_ARCHIVE ); m_customaccel_scale = gEngfuncs.pfnRegisterVariable ( "m_customaccel_scale", "0.04", FCVAR_ARCHIVE ); m_customaccel_max = gEngfuncs.pfnRegisterVariable ( "m_customaccel_max", "0", FCVAR_ARCHIVE );