Skip to content

Commit

Permalink
Merge pull request #148 from BSVino/always-fill-style-bar-after-race
Browse files Browse the repository at this point in the history
Always fill the style meter after a race
  • Loading branch information
TomyLobo authored Dec 22, 2018
2 parents 33a6f39 + 9cbd8b5 commit d3a6c9a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
7 changes: 6 additions & 1 deletion mp/src/game/server/sdk/sdk_player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3996,6 +3996,11 @@ bool CSDKPlayer::UseStylePoints (void)
return false;
}

void CSDKPlayer::FillMeter()
{
m_flStyleSkillCharge = da_stylemetertotalcharge.GetFloat();
}

void CSDKPlayer::ActivateMeter()
{
if (!UseStylePoints())
Expand All @@ -4006,7 +4011,7 @@ void CSDKPlayer::ActivateMeter()

m_flStylePoints = 0;

m_flStyleSkillCharge = da_stylemetertotalcharge.GetFloat();
FillMeter();

m_iStyleKillStreak = 0;

Expand Down
1 change: 1 addition & 0 deletions mp/src/game/server/sdk/sdk_player.h
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ class CSDKPlayer : public CBaseMultiplayerPlayer
static int GetStyleStars(float flPoints);
int GetStyleStars();

void FillMeter();
void ActivateMeter();

bool SetCharacter(const char* pszCharacter);
Expand Down
2 changes: 2 additions & 0 deletions mp/src/game/shared/sdk/sdk_gamerules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2324,6 +2324,8 @@ void CSDKGameRules::GiveMiniObjectiveRewardPlayer(CSDKPlayer* pPlayer)
if (!pPlayer->IsStyleSkillActive())
pPlayer->ActivateMeter();

pPlayer->FillMeter();

if ( pPlayer->Weapon_OwnsThisType("weapon_grenade") )
pPlayer->CBasePlayer::GiveAmmo(1, "grenades");
else
Expand Down

0 comments on commit d3a6c9a

Please sign in to comment.