Commit d7e44428 authored by Mikleo's avatar Mikleo
Browse files

Gradually relax vote requirements

parent 86c48cf9
Pipeline #8636 passed with stages
in 16 seconds
......@@ -8,7 +8,7 @@
#include <empstats>
#include <updater>
#define PluginVersion "1.08"
#define PluginVersion "1.09"
#define UPDATE_URL "https://sourcemod.docs.empiresmod.com/DraftPick/dist/updater.txt"
......@@ -93,6 +93,8 @@ int picksLeft = 0;
// could work around pause by detecting it.
int pickStartTime = 0;
int captainWaitStartTime = 0;
int squadLimitChangeTime = 0;
......@@ -1059,9 +1061,24 @@ public Action Timer_Tick(Handle timer,client)
if(stage == STAGE_CAPTAINVOTE || stage == STAGE_AUTOPICKWAIT && dp_autodraft_comms.IntValue == 1)
{
if(captainWaitStartTime == 0 && tickTime <= 0)
captainWaitStartTime = GetTime();
else if(tickTime > 0)
captainWaitStartTime = 0;
// round to nearest is best posibility, if very low it will be 0.
captainVoteLimit = RoundFloat(GetTeamClientCount(2) * dp_captainvote_playerratio.FloatValue);
if(captainVoteLimit == 0)
int limitDeductor = 0;
if(captainWaitStartTime != 0)
{
limitDeductor = (GetTime() - captainWaitStartTime) / 30;
}
captainVoteLimit = RoundFloat(GetTeamClientCount(2) * dp_captainvote_playerratio.FloatValue) - limitDeductor;
if(captainVoteLimit <= 0)
captainVoteLimit = 1;
......@@ -1437,7 +1454,7 @@ public Action Command_SetCaptain(int client, int args)
{
return Plugin_Handled;
}
if(stage != STAGE_CAPTAINVOTE)
if(stage != STAGE_CAPTAINVOTE && !(stage == STAGE_AUTOPICKWAIT && dp_autodraft_comms.IntValue == 1))
{
PrintToChat(client,"You must be in the captain vote stage to set captains");
return Plugin_Handled;
......@@ -3256,6 +3273,8 @@ Stage_Disabled_End()
Call_Finish();
captainWaitStartTime = 0;
RefreshTeamBalanceCvars();
PrintToChatAll("\x04[DP] \x01Draft pick enabled");
......@@ -4805,3 +4824,4 @@ RefreshTeamBalanceCvars()
mp_autoteambalance_skilldifference.IntValue = mp_autoteambalance_skilldifference_default;
}
}
......@@ -4,7 +4,7 @@
{
"Version"
{
"Latest" "1.08"
"Latest" "1.09"
}
}
......
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