Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always fill the style meter after a race #148

Merged
merged 2 commits into from
Dec 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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