Skip to content

Commit

Permalink
Merge pull request BSVino#49 from TomyLobo/random-commits
Browse files Browse the repository at this point in the history
Various cleanup
  • Loading branch information
TomyLobo committed Apr 3, 2016
2 parents aa00d4e + eb72736 commit 1002ec0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 17 deletions.
18 changes: 6 additions & 12 deletions mp/src/game/client/sdk/hud/sdk_hud_health.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,25 +171,19 @@ void CHudHealth::OnThink()
//-----------------------------------------------------------------------------
void CHudHealth::MsgFunc_Damage( bf_read &msg )
{
int armor = msg.ReadByte(); // armor
int damageTaken = msg.ReadByte(); // health
long bitsDamage = msg.ReadLong(); // damage bits
bitsDamage; // variable still sent but not used

Vector vecFrom;

vecFrom.x = msg.ReadBitCoord();
vecFrom.y = msg.ReadBitCoord();
vecFrom.z = msg.ReadBitCoord();
msg.ReadBitVec3Coord(vecFrom);

Assert(msg.GetNumBytesLeft() == 0);

// Actually took damage?
if ( damageTaken > 0 || armor > 0 )
if ( damageTaken > 0 )
{
if ( damageTaken > 0 )
{
// start the animation
g_pClientMode->GetViewportAnimationController()->StartAnimationSequence("HealthDamageTaken");
}
// start the animation
g_pClientMode->GetViewportAnimationController()->StartAnimationSequence("HealthDamageTaken");
}
}

Expand Down
8 changes: 4 additions & 4 deletions mp/src/game/server/sdk/sdk_player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2229,7 +2229,7 @@ int CSDKPlayer::GetMaxHealth() const

bool CSDKPlayer::ThrowActiveWeapon( bool bAutoSwitch )
{
return ThrowWeapon(GetActiveSDKWeapon());
return ThrowWeapon(GetActiveSDKWeapon(), bAutoSwitch);
}

bool CSDKPlayer::ThrowWeapon( CWeaponSDKBase* pWeapon, bool bAutoSwitch )
Expand Down Expand Up @@ -2494,7 +2494,7 @@ void CSDKPlayer::SDKThrowWeapon( CWeaponSDKBase *pWeapon, const Vector &vecForwa
if (!pWeapon)
return;

if (!FStrEq(pWeapon->GetSDKWpnData().m_szSingle, ""))
if (pWeapon->IsAkimbo())
{
// This is an akimbo weapon. Toss two singles instead.

Expand All @@ -2519,15 +2519,15 @@ void CSDKPlayer::SDKThrowWeapon( CWeaponSDKBase *pWeapon, const Vector &vecForwa
RemovePlayerItem (pAkimbos);

// Remove the single version also.
CWeaponSDKBase *pSingle = FindWeapon(AliasToWeaponID(pszSingle));
CWeaponSDKBase *pSingle = pAkimbos->FindSingleWeapon();
AssertMsg (pSingle, "How do you have akimbos without a single?");
if (pSingle)
RemovePlayerItem (pSingle);

return;
}

if (!FStrEq(pWeapon->GetSDKWpnData().m_szAkimbo, ""))
if (pWeapon->HasAkimbo())
{
// This is a single weapon that has an akimbo counterpart.
// Check to see if we have the akimbo, and if we do, remove it before tossing.
Expand Down
2 changes: 1 addition & 1 deletion mp/src/game/shared/sdk/weapon_akimbobase.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class CAkimboBase : public CWeaponSDKBase
virtual int GetMaxClip1(void) const;
virtual int GetWeight(void) const;

const Vector GetShootPosition(CSDKPlayer* pShooter);
virtual const Vector GetShootPosition(CSDKPlayer* pShooter);

// Finds the single variant of this akimbo weapon
CWeaponSDKBase *FindSingleWeapon();
Expand Down

0 comments on commit 1002ec0

Please sign in to comment.