Skip to content

Commit d557c8d

Browse files
committed
Update auto difficulty
- Start at 0 /base difficulty/ rather than 1 and increment by 1 for every additional player.
1 parent cc7a41c commit d557c8d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

scripting/srccoop_addon_difficulty.sp

+4-4
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ public void OnPluginStart()
3737
InitSourceCoopAddon();
3838

3939
g_pConvarDifficulty = CreateConVar("sourcecoop_difficulty", "0", "Sets the difficulty - from 0 (base difficulty) and up.", _, true, 0.0);
40-
g_pConvarDifficultyAuto = CreateConVar("sourcecoop_difficulty_auto", "2", "Sets automatic difficulty mode. -1 disables. 0 balances difficulty between min and max convars. Values above 0 set the difficulty increment per player, ignoring the min and max cvars.", _, true, -1.0);
41-
g_pConvarDifficultyAutoMin = CreateConVar("sourcecoop_difficulty_auto_min", "1", "When automatic difficulty mode is set to 0, this is the difficulty at 1 player.", _, true, 0.0);
40+
g_pConvarDifficultyAuto = CreateConVar("sourcecoop_difficulty_auto", "1", "Sets automatic difficulty mode. -1 disables. 0 balances difficulty between min and max convars. Values above 0 set the difficulty increment per player, ignoring the min and max cvars.", _, true, -1.0);
41+
g_pConvarDifficultyAutoMin = CreateConVar("sourcecoop_difficulty_auto_min", "0", "When automatic difficulty mode is set to 0, this is the difficulty at 1 player.", _, true, 0.0);
4242
g_pConvarDifficultyAutoMax = CreateConVar("sourcecoop_difficulty_auto_max", "20", "When automatic difficulty mode is set to 0, this is the difficulty at max players.", _, true, 0.0);
4343
g_pConvarDifficultyAnnounce = CreateConVar("sourcecoop_difficulty_announce", "1", "Toggles announcing changes in difficulty.", _, true, 0.0, true, 1.0);
4444
g_pConvarDifficultyIgnoreDamageTo = CreateConVar("sourcecoop_difficulty_ignoredmgto", "npc_headcrab;npc_barnacle;npc_puffballfungus", "List of classnames where player->npc damage is exempt from difficulty scaling. Separated by semicolon.");
@@ -118,7 +118,7 @@ public void Frame_PlayerChangeTeamPost()
118118

119119
void UpdateAutoDifficulty()
120120
{
121-
if (g_pConvarDifficultyAuto.FloatValue == 0)
121+
if (g_pConvarDifficultyAuto.FloatValue == 0.0)
122122
{
123123
int min = g_pConvarDifficultyAutoMin.IntValue;
124124
int max = g_pConvarDifficultyAutoMax.IntValue;
@@ -134,7 +134,7 @@ void UpdateAutoDifficulty()
134134
}
135135
else if (g_pConvarDifficultyAuto.FloatValue > 0.0)
136136
{
137-
g_pConvarDifficulty.IntValue = RoundFloat(g_pConvarDifficultyAuto.FloatValue * GetRealClientCount(true, false, true));
137+
g_pConvarDifficulty.IntValue = RoundFloat(g_pConvarDifficultyAuto.FloatValue * (GetRealClientCount(true, false, true) - 1));
138138
}
139139
}
140140

0 commit comments

Comments
 (0)