Commit 8ee4dfd8 authored by Mikleo's avatar Mikleo
Browse files

fix joining players joining BE after restarting draft.

parent a606db96
Pipeline #6214 passed with stages
in 20 seconds
......@@ -8,7 +8,7 @@
#include <empstats>
#include <updater>
#define PluginVersion "0.92"
#define PluginVersion "0.93"
#define UPDATE_URL "https://sourcemod.docs.empiresmod.com/DraftPick/dist/updater.txt"
......@@ -254,8 +254,9 @@ public void OnPluginStart()
dp_music_volume = CreateConVar("dp_music_volume", "0.5", "The volume music plays at");
dp_music.AddChangeHook(dp_music_changed);
dp_music_volume.AddChangeHook(dp_music_volume_changed);
dp_pick_music = CreateConVar("dp_pick_music", "draftpick/draft_pick2.mp3","");
dp_pick_music_repeat = CreateConVar("dp_pick_music_repeat", "102","");
// use pre included music to save download table time.
dp_pick_music = CreateConVar("dp_pick_music", "music/our_obdurate_past.mp3","");
dp_pick_music_repeat = CreateConVar("dp_pick_music_repeat", "212","");
dp_pick_end_sound = CreateConVar("dp_pick_end_sound", "draftpick/draft_complete.mp3","");
dp_join_music = CreateConVar("dp_join_music", "", "");
dp_your_turn_sound = CreateConVar("dp_your_turn_sound", "draftpick/your_turn.wav", "");
......@@ -463,6 +464,7 @@ public Action Command_RestartDraft(int client, int args)
}
else
{
// end the current draft and set up a new one.
draftBegun = false;
DraftEnded();
......@@ -1856,7 +1858,7 @@ void SetUpDraft(mode)
if(!EU_HasGameStarted())
{
dp_in_draft.IntValue = 1;
// make sure everyone is on nf
// make sure everyone on be is moved to nf
for (int i=1; i<=MaxClients; i++)
{
if(IsClientInGame(i) && GetClientTeam(i) == 3)
......@@ -1865,6 +1867,22 @@ void SetUpDraft(mode)
}
}
// put any currently joining players in nf, mainly used for restarting draft.
for(int i = 0;i<joiningPlayers.Length;i++)
{
int client = joiningPlayers.Get(i);
if(IsClientInGame(i))
{
ForceTeam(i,2);
joinTime[client] = -1;
}
}
joiningPlayers.Clear();
// disable ncev until we can start the game.
AddCommandListener(Command_Join_Squad_Draft, "emp_squad_join");
......@@ -4517,6 +4535,7 @@ public Action Command_DraftMusic(int client, int args)
public Action Command_ReloadDraftMusic(int client, int args)
{
LoadDraftMusic();
return Plugin_Handled;
}
public Action Timer_CheckForceAuto(Handle timer,any dataPack)
......
......@@ -4,7 +4,7 @@
{
"Version"
{
"Latest" "0.92"
"Latest" "0.93"
}
}
......
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