Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
sourcemod
DraftPick
Commits
d7e44428
Commit
d7e44428
authored
Feb 09, 2020
by
Mikleo
Browse files
Gradually relax vote requirements
parent
86c48cf9
Pipeline
#8636
passed with stages
in 16 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
dist/addons/sourcemod/plugins/draftpick.smx
View file @
d7e44428
No preview for this file type
dist/addons/sourcemod/scripting/draftpick.sp
View file @
d7e44428
...
...
@@ -8,7 +8,7 @@
#include <empstats>
#include <updater>
#define PluginVersion "1.0
8
"
#define PluginVersion "1.0
9
"
#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;
}
}
dist/updater.txt
View file @
d7e44428
...
...
@@ -4,7 +4,7 @@
{
"Version"
{
"Latest" "1.0
8
"
"Latest" "1.0
9
"
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment