mirror of
https://github.com/Jackzmc/sourcemod-plugins.git
synced 2025-05-07 15:23:20 +00:00
crescendo control: Tweak percentages
This commit is contained in:
parent
e675f1b183
commit
8a76c34f8f
2 changed files with 3 additions and 4 deletions
|
@ -122,15 +122,14 @@ stock bool IsActivationAllowed(float flowmax, float threshold) {
|
|||
totalSurvivors++;
|
||||
}
|
||||
}
|
||||
PrintDebug("%d far/%d total", farSurvivors, totalSurvivors);
|
||||
if(farSurvivors == 0) return true;
|
||||
float average = totalFlow / farSurvivors;
|
||||
PrintDebug("average %f - difference %f", average, flowmax - average);
|
||||
float percentFar = float(farSurvivors) / float(totalSurvivors);
|
||||
|
||||
PrintDebug("average %f - difference %f - % far %f%% ", average, flowmax - average, percentFar);
|
||||
//If the average is in the range, allow
|
||||
if(flowmax - average <= threshold) return true;
|
||||
//If not, check the ratio of players
|
||||
float percentFar = float(farSurvivors) / float(totalSurvivors);
|
||||
PrintDebug("Percentage of far players: %f%% | Average %f", percentFar, average);
|
||||
return percentFar <= 0.30;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue