Skip to content

Commit adc2f02

Browse files
committed
Implement ValveSoftware#1463, quiver armor stuff
1 parent 18901e6 commit adc2f02

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

src/game/shared/tf/tf_player_shared.cpp

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4981,7 +4981,9 @@ static int GetResistShieldSkinForResistType( ETFCond eCond )
49814981
return 4;
49824982

49834983
default:
4984+
#ifndef BDSBASE
49844985
AssertMsg( 0, "Invalid condition passed into AddResistShield" );
4986+
#endif
49854987
return 0;
49864988
}
49874989
}
@@ -5009,7 +5011,18 @@ static void AddResistShield( C_LocalTempEntity** pShield, CTFPlayer* pPlayer, ET
50095011
(*pShield)->ChangeTeam( pPlayer->m_Shared.GetDisplayedTeam() );
50105012
if( TFGameRules() && TFGameRules()->IsMannVsMachineMode() && pPlayer->GetTeamNumber() == TF_TEAM_BLUE )
50115013
{
5014+
#ifdef BDSBASE
5015+
int skin = GetResistShieldSkinForResistType(eCond);
5016+
5017+
if (skin == 0)
5018+
{
5019+
(*pShield)->m_nSkin = (pPlayer->m_Shared.GetDisplayedTeam() == TF_TEAM_RED) ? 0 : 1;
5020+
}
5021+
5022+
(*pShield)->m_nSkin = skin;
5023+
#else
50125024
(*pShield)->m_nSkin = GetResistShieldSkinForResistType( eCond );
5025+
#endif
50135026
}
50145027
else
50155028
{
@@ -5227,6 +5240,23 @@ void CTFPlayerShared::OnRemoveRuneResist( void )
52275240
#endif
52285241
}
52295242

5243+
#if defined(QUIVER_DLL)
5244+
void CTFPlayerShared::OnAddArmor(void)
5245+
{
5246+
#ifdef CLIENT_DLL
5247+
// Do use the condition bit here, it's passed along and is expected to be a cond.
5248+
AddResistShield(&m_pOuter->m_pTempShield, m_pOuter, TF_COND_INVALID);
5249+
#endif
5250+
}
5251+
5252+
void CTFPlayerShared::OnRemoveArmor(void)
5253+
{
5254+
#ifdef CLIENT_DLL
5255+
RemoveResistShield(&m_pOuter->m_pTempShield, m_pOuter);
5256+
#endif
5257+
}
5258+
#endif
5259+
52305260
//-----------------------------------------------------------------------------
52315261
// Purpose:
52325262
//-----------------------------------------------------------------------------
@@ -13068,8 +13098,19 @@ bool CTFPlayer::TryToPickupBuilding()
1306813098
CTFWeaponBuilder *pBuilder = dynamic_cast<CTFWeaponBuilder*>(Weapon_OwnsThisID( TF_WEAPON_BUILDER ));
1306913099
if ( pBuilder )
1307013100
{
13101+
#ifdef BDSBASE
13102+
if (pWeapon)
13103+
{
13104+
// Prevent weapon from attacking this frame after it's been holstered
13105+
pWeapon->m_flNextPrimaryAttack = gpGlobals->curtime + 0.1f;
13106+
13107+
if (pWeapon == pBuilder)
13108+
SetActiveWeapon(NULL);
13109+
}
13110+
#else
1307113111
if ( GetActiveTFWeapon() == pBuilder )
1307213112
SetActiveWeapon( NULL );
13113+
#endif
1307313114

1307413115
Weapon_Switch( pBuilder );
1307513116
pBuilder->m_flNextSecondaryAttack = gpGlobals->curtime + 0.5f;

src/game/shared/tf/tf_player_shared.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,11 @@ class CTFPlayerShared : public CGameEventListener
336336

337337
bool ShouldSuppressPrediction( void );
338338

339+
#if defined(QUIVER_DLL)
340+
void OnAddArmor(void);
341+
void OnRemoveArmor(void);
342+
#endif
343+
339344
void SetCarryingRuneType( RuneTypes_t rt );
340345
RuneTypes_t GetCarryingRuneType( void ) const;
341346
bool IsCarryingRune( void ) const { return GetCarryingRuneType() != RUNE_NONE; }

0 commit comments

Comments
 (0)