Commit 3a9f47e5 authored by Mikleo's avatar Mikleo
Browse files

fix error that prevented draft starting correctly.

parent 33124a52
Pipeline #5975 passed with stages
in 23 seconds
......@@ -8,7 +8,7 @@
#include <empstats>
#include <updater>
#define PluginVersion "0.84"
#define PluginVersion "0.85"
#define UPDATE_URL "https://sourcemod.docs.empiresmod.com/DraftPick/dist/updater.txt"
......@@ -51,10 +51,11 @@ int stage = STAGE_DISABLED;
#define TEAM_BE 1;
ConVar mp_autoteambalance,mp_teams_unbalance_limit,cv_autoassign,cv_allowspectators,dp_default_draftmode, dp_default_draftmode_min_players,dp_captain_vote_time,dp_pick_wait_time,dp_pick_initial_multiplier,dp_time_increment,dp_in_draft,dp_maxpick,dp_squadlimitdefault,dp_autopick_randomizer,dp_forceauto_max_imbalance;
ConVar mp_autoteambalance,mp_autoteambalance_skilldifference,cv_autoassign,cv_allowspectators,dp_default_draftmode, dp_default_draftmode_min_players,dp_captain_vote_time,dp_pick_wait_time,dp_pick_initial_multiplier,dp_time_increment,dp_in_draft,dp_maxpick,dp_squadlimitdefault,dp_autopick_randomizer,dp_forceauto_max_imbalance;
int mp_autoteambalance_default = 1;
int mp_teams_unbalance_limit_default = 0;
int cv_autoassign_default = 0;
int mp_autoteambalance_skilldifference_default = 10;
//sound convars
ConVar dp_music,dp_music_volume,dp_pick_music,dp_pick_music_repeat,dp_pick_end_sound,dp_join_music,dp_your_turn_sound,dp_opp_turn_sound,dp_min_players;
......@@ -228,7 +229,7 @@ public void OnPluginStart()
RegConsoleCmd("sm_dmusic", Command_DraftMusic);
mp_autoteambalance = FindConVar("mp_autoteambalance");
mp_teams_unbalance_limit = FindConVar("mp_teams_unbalance_limit");
mp_autoteambalance_skilldifference = FindConVar("mp_autoteambalance_skilldifference");
cv_autoassign = FindConVar("emp_sv_forceautoassign");
cv_allowspectators = FindConVar("emp_allowspectators");
......@@ -237,7 +238,7 @@ public void OnPluginStart()
AddCommandListener(Command_Join_Team, "jointeam");
dp_default_draftmode = CreateConVar("dp_default_draftmode", "None", "The default draft mode. e.g. 'autodraft'");
dp_default_draftmode_min_players = CreateConVar("dp_default_draftmode_min_players", "25", "The minimum players required to intiate the default draft mode");
dp_default_draftmode_min_players = CreateConVar("dp_default_draftmode_min_players", "25", "The minimum players required to initiate the default draft mode");
dp_min_players = CreateConVar("dp_minplayers", "10", "The minimum number of players after which draft mode is disabled.");
dp_captain_vote_time = CreateConVar("dp_captain_vote_time", "100", "The time set in the captain vote stage");
......@@ -261,7 +262,8 @@ public void OnPluginStart()
dp_autopick_randomizer = CreateConVar("dp_autopick_randomizer", "20.0", "");
dp_forceauto_max_imbalance = CreateConVar("dp_forceauto_max_imbalance", "1", "");
// effectively disable this because disabling forceauto doesent work.
dp_forceauto_max_imbalance = CreateConVar("dp_forceauto_max_imbalance", "100", "");
// create the directory for the teams
CreateDirectory("addons/sourcemod/data/draftpick/teams",3);
......@@ -2024,7 +2026,8 @@ public Action StartDraft(Handle timer)
public OnConfigsExecuted()
{
mp_autoteambalance_default = mp_autoteambalance.IntValue;
mp_teams_unbalance_limit_default = mp_teams_unbalance_limit.IntValue;
mp_autoteambalance_skilldifference_default = mp_autoteambalance_skilldifference.IntValue;
cv_autoassign_default = cv_autoassign.IntValue;
RefreshTeamBalanceCvars();
......@@ -2502,6 +2505,10 @@ void ForceTeam(int client,int team)
TempAllowSpec();
FakeClientCommandEx(client, "jointeam %d", team);
}
else if (team == 4)
{
FakeClientCommandEx(client, "jointeam 4");
}
else if(team >=2)
{
// set obsmode to none enables players to spawn
......@@ -4598,12 +4605,11 @@ RefreshTeamBalanceCvars()
if(draftEnabled || dp_simplebalance.IntValue > 0)
{
mp_autoteambalance.IntValue = 0;
mp_teams_unbalance_limit.IntValue = 0;
mp_autoteambalance_skilldifference.IntValue = 100000;
}
else
{
mp_autoteambalance.IntValue = mp_autoteambalance_default;
mp_teams_unbalance_limit.IntValue = mp_teams_unbalance_limit_default;
mp_autoteambalance_skilldifference.IntValue = mp_autoteambalance_skilldifference_default;
}
}
......@@ -4,7 +4,7 @@
{
"Version"
{
"Latest" "0.84"
"Latest" "0.85"
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment