Skip to content
This repository was archived by the owner on May 1, 2019. It is now read-only.

Commit 36c9b99

Browse files
committed
fix extend map with mp_timelimit 0 and mapm_extended_type 1
1 parent 4ed41ce commit 36c9b99

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

mapmanager.sma

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#endif
66

77
#define PLUGIN "Map Manager"
8-
#define VERSION "2.5.56"
8+
#define VERSION "2.5.57"
99
#define AUTHOR "Mistrick"
1010

1111
#pragma semicolon 1
@@ -1460,16 +1460,18 @@ public StartVote(id)
14601460
}
14611461
}
14621462

1463+
new bAllow = get_pcvar_num(g_pCvars[EXTENDED_TYPE]) == 1 && (get_pcvar_num(g_pCvars[MAXROUNDS]) || get_pcvar_num(g_pCvars[WINLIMIT]));
1464+
14631465
#if defined FUNCTION_RTV && defined FUNCTION_NIGHTMODE
1464-
if(get_pcvar_float(g_pCvars[TIMELIMIT]) > 0.0 && !g_bRockVote && g_iExtendedMax < get_pcvar_num(g_pCvars[EXTENDED_MAX]) && (g_bNightMode && g_bCurMapInNightMode || !g_bNightMode))
1466+
if((get_pcvar_float(g_pCvars[TIMELIMIT]) > 0.0 || bAllow) && !g_bRockVote && g_iExtendedMax < get_pcvar_num(g_pCvars[EXTENDED_MAX]) && (g_bNightMode && g_bCurMapInNightMode || !g_bNightMode))
14651467
#else
14661468
#if defined FUNCTION_RTV
1467-
if(get_pcvar_float(g_pCvars[TIMELIMIT]) > 0.0 && !g_bRockVote && g_iExtendedMax < get_pcvar_num(g_pCvars[EXTENDED_MAX]))
1469+
if((get_pcvar_float(g_pCvars[TIMELIMIT]) > 0.0 || bAllow) && !g_bRockVote && g_iExtendedMax < get_pcvar_num(g_pCvars[EXTENDED_MAX]))
14681470
#else
14691471
#if defined FUNCTION_NIGHTMODE
1470-
if(get_pcvar_float(g_pCvars[TIMELIMIT]) > 0.0 && g_iExtendedMax < get_pcvar_num(g_pCvars[EXTENDED_MAX]) && (g_bNightMode && g_bCurMapInNightMode || !g_bNightMode))
1472+
if((get_pcvar_float(g_pCvars[TIMELIMIT]) > 0.0 || bAllow) && g_iExtendedMax < get_pcvar_num(g_pCvars[EXTENDED_MAX]) && (g_bNightMode && g_bCurMapInNightMode || !g_bNightMode))
14711473
#else
1472-
if(get_pcvar_float(g_pCvars[TIMELIMIT]) > 0.0 && g_iExtendedMax < get_pcvar_num(g_pCvars[EXTENDED_MAX]))
1474+
if((get_pcvar_float(g_pCvars[TIMELIMIT]) > 0.0 || bAllow) && g_iExtendedMax < get_pcvar_num(g_pCvars[EXTENDED_MAX]))
14731475
#endif
14741476
#endif
14751477
#endif
@@ -1767,19 +1769,18 @@ FinishVote()
17671769

17681770
if(get_pcvar_num(g_pCvars[EXTENDED_TYPE]) == 1 && (iWinLimit || iMaxRounds))
17691771
{
1772+
new iRounds = get_pcvar_num(g_pCvars[EXTENDED_ROUNDS]);
1773+
17701774
if(iWinLimit > 0)
17711775
{
1772-
set_pcvar_num(g_pCvars[WINLIMIT], iWinLimit + get_pcvar_num(g_pCvars[EXTENDED_ROUNDS]));
1776+
set_pcvar_num(g_pCvars[WINLIMIT], iWinLimit + iRounds);
17731777
}
1774-
17751778
if(iMaxRounds > 0)
17761779
{
1777-
set_pcvar_num(g_pCvars[MAXROUNDS], iMaxRounds + get_pcvar_num(g_pCvars[EXTENDED_ROUNDS]));
1780+
set_pcvar_num(g_pCvars[MAXROUNDS], iMaxRounds + iRounds);
17781781
}
17791782

1780-
new iRounds = get_pcvar_num(g_pCvars[EXTENDED_ROUNDS]);
17811783
new szRounds[16]; get_ending(iRounds, "MAPM_ROUND1", "MAPM_ROUND2", "MAPM_ROUND3", szRounds, charsmax(szRounds));
1782-
17831784
client_print_color(0, print_team_default, "%s^1 %L %L.", PREFIX, LANG_PLAYER, "MAPM_MAP_EXTEND", iRounds, LANG_PLAYER, szRounds);
17841785
}
17851786
else

0 commit comments

Comments
 (0)