You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FAKE_BOOL_CVAR(cs2f_votemanager_enable, "Whether to enable votemanager features such as RTV and extends", g_bVoteManagerEnable, false, false)
54
55
FAKE_FLOAT_CVAR(cs2f_extend_vote_delay, "If cs2f_extend_mode is 2, Time after map start until extend votes can be triggered", g_flExtendVoteDelay, 120.0f, false)
55
56
FAKE_INT_CVAR(cs2f_extend_mode, "How extend votes are handled. (0=off, 1=only admins can start, 2=players can start with !ve, 3=auto start at given timeleft)", g_ExtendVoteMode, (int)EExtendVoteMode::EXTENDVOTE_ADMINONLY, false)
56
-
FAKE_INT_CVAR(cs2f_extends, "Maximum extends per map", g_iExtendsLeft, 1, false)
57
+
FAKE_INT_CVAR(cs2f_extends, "Maximum extends per map", g_iMaxExtends, 1, false)
57
58
FAKE_FLOAT_CVAR(cs2f_extend_success_ratio, "Ratio needed to pass an extend vote", g_flExtendSucceedRatio, 0.5f, false)
58
59
FAKE_INT_CVAR(cs2f_extend_time, "Time to add per extend in minutes", g_iExtendTimeToAdd, 20, false)
59
60
FAKE_FLOAT_CVAR(cs2f_extend_vote_start_time, "If cs2f_extend_mode is 3, start an extend vote at this timeleft (minutes)", g_flExtendVoteStartTime, 4.0f, false)
@@ -72,6 +73,8 @@ void VoteManager_Init()
72
73
g_RTVState = ERTVState::MAP_START;
73
74
g_ExtendState = EExtendState::MAP_START;
74
75
76
+
g_iExtends = 0;
77
+
75
78
newCTimer(g_flExtendVoteDelay, false, true, []()
76
79
{
77
80
if (g_ExtendState < EExtendState::POST_EXTEND_NO_EXTENDS_LEFT)
@@ -110,7 +113,7 @@ float TimerCheckTimeleft()
110
113
return flExtendVoteTickrate;
111
114
112
115
// No more extends or map RTVd
113
-
if (g_iExtendsLeft <= 0 || g_ExtendState >= EExtendState::POST_EXTEND_NO_EXTENDS_LEFT)
116
+
if ((g_iMaxExtends - g_iExtends) <= 0 || g_ExtendState >= EExtendState::POST_EXTEND_NO_EXTENDS_LEFT)
if (g_ExtendState == EExtendState::POST_EXTEND_FAILED)
565
+
ClientPrint(player, HUD_PRINTTALK, CHAT_PREFIX "The map had %i/%i extends left, but the last extend vote failed.", g_iMaxExtends - g_iExtends, g_iMaxExtends);
566
+
else
567
+
ClientPrint(player, HUD_PRINTTALK, CHAT_PREFIX "The map has %i/%i extends left.", g_iMaxExtends - g_iExtends, g_iMaxExtends);
568
+
}
595
569
}
596
570
597
571
CON_COMMAND_CHAT(timeleft, "- Display time left to end of current map.")
@@ -682,11 +656,11 @@ void VoteExtendHandler(YesNoVoteAction action, int param1, int param2)
682
656
{
683
657
if ((YesNoVoteEndReason)param1 == YesNoVoteEndReason::VoteEnd_Cancelled)
684
658
{
685
-
// Admin cancelled so stop further automatic votes
659
+
// Admin cancelled so stop further votes
686
660
// It will reenable if an admin manually calls a vote
687
661
if (g_ExtendVoteMode == EExtendVoteMode::EXTENDVOTE_AUTO)
0 commit comments