Skip to content

Commit

Permalink
Merge pull request #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 c638a64 + b3f0c83 commit 505564c
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/da/hud/da_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/da/da_player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2229,7 +2229,7 @@ int CDAPlayer::GetMaxHealth() const

bool CDAPlayer::ThrowActiveWeapon( bool bAutoSwitch )
{
return ThrowWeapon(GetActiveDAWeapon());
return ThrowWeapon(GetActiveDAWeapon(), bAutoSwitch);
}

bool CDAPlayer::ThrowWeapon( CWeaponDABase* pWeapon, bool bAutoSwitch )
Expand Down Expand Up @@ -2494,7 +2494,7 @@ void CDAPlayer::SDKThrowWeapon( CWeaponDABase *pWeapon, const Vector &vecForward
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 CDAPlayer::SDKThrowWeapon( CWeaponDABase *pWeapon, const Vector &vecForward
RemovePlayerItem (pAkimbos);

// Remove the single version also.
CWeaponDABase *pSingle = FindWeapon(AliasToWeaponID(pszSingle));
CWeaponDABase *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/da/weapon_akimbobase.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class CAkimboBase : public CWeaponDABase
virtual int GetMaxClip1(void) const;
virtual int GetWeight(void) const;

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

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

0 comments on commit 505564c

Please sign in to comment.