done some code cleanup and removed that Practice mode is getting credits
This commit is contained in:
parent
0515c49a50
commit
2054a7d279
2 changed files with 31 additions and 51 deletions
Binary file not shown.
|
@ -6,7 +6,7 @@
|
|||
#pragma semicolon 1
|
||||
#pragma newdecls required
|
||||
|
||||
#define PLUGIN_VERSION "1.4.4"
|
||||
#define PLUGIN_VERSION "1.4.6"
|
||||
chatstrings_t gS_ChatStrings;
|
||||
stylesettings_t gA_StyleSettings[STYLE_LIMIT];
|
||||
|
||||
|
@ -144,7 +144,7 @@ public void Shavit_OnFinish(int client, int style, float time, int jumps, int st
|
|||
char sStyleSpecialString[sizeof(stylestrings_t::sSpecialString)];
|
||||
Shavit_GetStyleStrings(style, sSpecialString, sStyleSpecialString, sizeof(sStyleSpecialString));
|
||||
|
||||
if (StrContains(sStyleSpecialString, "segments") != -1 || gA_StyleSettings[style].bUnranked)
|
||||
if (StrContains(sStyleSpecialString, "segments") != -1 || gA_StyleSettings[style].bUnranked == true || Shavit_IsPracticeMode(client) == true)
|
||||
return;
|
||||
|
||||
if (!g_cvTasEnabled.BoolValue)
|
||||
|
@ -164,10 +164,7 @@ public void Shavit_OnFinish(int client, int style, float time, int jumps, int st
|
|||
|
||||
if (g_cvNewCalc.BoolValue == true)
|
||||
{
|
||||
float fMultiplier = gA_StyleSettings[style].fRankingMultiplier;
|
||||
float fResult = (g_cvNormalAmount.IntValue * g_iTier) * fMultiplier;
|
||||
int iRoundResult = RoundFloat(fResult);
|
||||
iCredits = iRoundResult;
|
||||
iCredits = CalculatePoints(g_cvNormalAmount.IntValue, style);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -184,10 +181,7 @@ public void Shavit_OnFinish(int client, int style, float time, int jumps, int st
|
|||
|
||||
if (g_cvNewCalc.BoolValue == true)
|
||||
{
|
||||
float fMultiplier = gA_StyleSettings[style].fRankingMultiplier;
|
||||
float fResult = (g_cvNormalAmountAgain.IntValue * g_iTier) * fMultiplier;
|
||||
int iRoundResult = RoundFloat(fResult);
|
||||
iCredits = iRoundResult;
|
||||
iCredits = CalculatePoints(g_cvNormalAmountAgain.IntValue, style);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -211,10 +205,7 @@ public void Shavit_OnFinish(int client, int style, float time, int jumps, int st
|
|||
int iCredits;
|
||||
if (g_cvNewCalc.BoolValue == true)
|
||||
{
|
||||
float fMultiplier = gA_StyleSettings[style].fRankingMultiplier;
|
||||
float fResult = g_cvNormalBAmount.IntValue * fMultiplier;
|
||||
int iRoundResult = RoundFloat(fResult);
|
||||
iCredits = iRoundResult;
|
||||
iCredits = CalculatePointsBonus(g_cvNormalBAmount.IntValue, style);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -229,10 +220,7 @@ public void Shavit_OnFinish(int client, int style, float time, int jumps, int st
|
|||
int iCredits;
|
||||
if (g_cvNewCalc.BoolValue == true)
|
||||
{
|
||||
float fMultiplier = gA_StyleSettings[style].fRankingMultiplier;
|
||||
float fResult = g_cvNormalBAmountAgain.IntValue * fMultiplier;
|
||||
int iRoundResult = RoundFloat(fResult);
|
||||
iCredits = iRoundResult;
|
||||
iCredits = CalculatePointsBonus(g_cvNormalBAmountAgain.IntValue, style);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -257,10 +245,7 @@ public void Shavit_OnFinish(int client, int style, float time, int jumps, int st
|
|||
int iCredits;
|
||||
if (g_cvNewCalc.BoolValue == true)
|
||||
{
|
||||
float fMultiplier = gA_StyleSettings[style].fRankingMultiplier;
|
||||
float fResult = (g_cvPBAmount.IntValue * g_iTier) * fMultiplier;
|
||||
int iRoundResult = RoundFloat(fResult);
|
||||
iCredits = iRoundResult;
|
||||
iCredits = CalculatePoints(g_cvPBAmount.IntValue, style);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -275,10 +260,7 @@ public void Shavit_OnFinish(int client, int style, float time, int jumps, int st
|
|||
int iCredits;
|
||||
if (g_cvNewCalc.BoolValue == true)
|
||||
{
|
||||
float fMultiplier = gA_StyleSettings[style].fRankingMultiplier;
|
||||
float fResult = (g_cvPBAmountAgain.IntValue * g_iTier) * fMultiplier;
|
||||
int iRoundResult = RoundFloat(fResult);
|
||||
iCredits = iRoundResult;
|
||||
iCredits = CalculatePoints(g_cvPBAmountAgain.IntValue, style);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -303,10 +285,7 @@ public void Shavit_OnFinish(int client, int style, float time, int jumps, int st
|
|||
int iCredits;
|
||||
if (g_cvNewCalc.BoolValue == true)
|
||||
{
|
||||
float fMultiplier = gA_StyleSettings[style].fRankingMultiplier;
|
||||
float fResult = g_cvBPbAmount.IntValue * fMultiplier;
|
||||
int iRoundResult = RoundFloat(fResult);
|
||||
iCredits = iRoundResult;
|
||||
iCredits = CalculatePointsBonus(g_cvBPbAmount.IntValue, style);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -321,10 +300,7 @@ public void Shavit_OnFinish(int client, int style, float time, int jumps, int st
|
|||
int iCredits;
|
||||
if (g_cvNewCalc.BoolValue == true)
|
||||
{
|
||||
float fMultiplier = gA_StyleSettings[style].fRankingMultiplier;
|
||||
float fResult = g_cvBPbAmountAgain.IntValue * fMultiplier;
|
||||
int iRoundResult = RoundFloat(fResult);
|
||||
iCredits = iRoundResult;
|
||||
iCredits = CalculatePointsBonus(g_cvBPbAmountAgain.IntValue, style);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -346,7 +322,7 @@ public void Shavit_OnWorldRecord(int client, int style, float time, int jumps, i
|
|||
char sStyleSpecialString[sizeof(stylestrings_t::sSpecialString)];
|
||||
Shavit_GetStyleStrings(style, sSpecialString, sStyleSpecialString, sizeof(sStyleSpecialString));
|
||||
|
||||
if (StrContains(sStyleSpecialString, "segments") != -1 || gA_StyleSettings[style].bUnranked)
|
||||
if (StrContains(sStyleSpecialString, "segments") != -1 || gA_StyleSettings[style].bUnranked == true || Shavit_IsPracticeMode(client) == true)
|
||||
return;
|
||||
|
||||
if (!g_cvTasEnabled.BoolValue)
|
||||
|
@ -362,10 +338,7 @@ public void Shavit_OnWorldRecord(int client, int style, float time, int jumps, i
|
|||
int iCredits;
|
||||
if (g_cvNewCalc.BoolValue == true)
|
||||
{
|
||||
float fMultiplier = gA_StyleSettings[style].fRankingMultiplier;
|
||||
float fResult = (g_cvWrAmount.IntValue * g_iTier) * fMultiplier;
|
||||
int iRoundResult = RoundFloat(fResult);
|
||||
iCredits = iRoundResult;
|
||||
iCredits = CalculatePoints(g_cvWrAmount.IntValue, style);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -380,10 +353,7 @@ public void Shavit_OnWorldRecord(int client, int style, float time, int jumps, i
|
|||
int iCredits;
|
||||
if (g_cvNewCalc.BoolValue == true)
|
||||
{
|
||||
float fMultiplier = gA_StyleSettings[style].fRankingMultiplier;
|
||||
float fResult = (g_cvWrAmountAgain.IntValue * g_iTier) * fMultiplier;
|
||||
int iRoundResult = RoundFloat(fResult);
|
||||
iCredits = iRoundResult;
|
||||
iCredits = CalculatePoints(g_cvWrAmountAgain.IntValue, style);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -405,10 +375,7 @@ public void Shavit_OnWorldRecord(int client, int style, float time, int jumps, i
|
|||
int iCredits;
|
||||
if (g_cvNewCalc.BoolValue == true)
|
||||
{
|
||||
float fMultiplier = gA_StyleSettings[style].fRankingMultiplier;
|
||||
float fResult = g_cvWrBAmount.IntValue * fMultiplier;
|
||||
int iRoundResult = RoundFloat(fResult);
|
||||
iCredits = iRoundResult;
|
||||
iCredits = CalculatePointsBonus(g_cvWrBAmount.IntValue, style);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -424,10 +391,7 @@ public void Shavit_OnWorldRecord(int client, int style, float time, int jumps, i
|
|||
int iCredits;
|
||||
if (g_cvNewCalc.BoolValue == true)
|
||||
{
|
||||
float fMultiplier = gA_StyleSettings[style].fRankingMultiplier;
|
||||
float fResult = g_cvWrBAmountAgain.IntValue * fMultiplier;
|
||||
int iRoundResult = RoundFloat(fResult);
|
||||
iCredits = iRoundResult;
|
||||
iCredits = CalculatePointsBonus(g_cvWrBAmountAgain.IntValue, style);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -441,3 +405,19 @@ public void Shavit_OnWorldRecord(int client, int style, float time, int jumps, i
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int CalculatePoints(int cvAmount, int style)
|
||||
{
|
||||
float fRankingMultiplier = gA_StyleSettings[style].fRankingMultiplier;
|
||||
float fResult = (cvAmount * g_iTier) * fRankingMultiplier;
|
||||
int iRoundResult = RoundFloat(fResult);
|
||||
return iRoundResult;
|
||||
}
|
||||
|
||||
public int CalculatePointsBonus(int cvAmount, int style)
|
||||
{
|
||||
float fRankingMultiplier = gA_StyleSettings[style].fRankingMultiplier;
|
||||
float fResult = cvAmount * fRankingMultiplier;
|
||||
int iRoundResult = RoundFloat(fResult);
|
||||
return iRoundResult;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue