Skip to content

Commit

Permalink
Merge branch 'opfor' into opforfixed
Browse files Browse the repository at this point in the history
  • Loading branch information
nekonomicon committed Dec 21, 2024
2 parents 4fb8f8f + ab6f6a3 commit 4ad9183
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 9 deletions.
5 changes: 5 additions & 0 deletions cl_dll/input_goldsource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down
32 changes: 23 additions & 9 deletions dlls/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -804,21 +804,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.
Expand Down

0 comments on commit 4ad9183

Please sign in to comment.