added mapvote and forcertv related to last day

This commit is contained in:
jenz 2024-02-05 22:23:30 +01:00
parent 1e1eed7242
commit 950d7d8c68

View File

@ -1130,6 +1130,7 @@ public Action Timer_switchingModel(Handle timer, any data)
public void LoadWave(int wave) public void LoadWave(int wave)
{ {
KeyValues kv = CreateKeyValues("Waves"); KeyValues kv = CreateKeyValues("Waves");
KeyValues kv1 = CreateKeyValues("Waves");
int l_iBotQuote; int l_iBotQuote;
char l_cJumptokey[16]; char l_cJumptokey[16];
char l_cJumptokey1[16]; char l_cJumptokey1[16];
@ -1146,6 +1147,15 @@ public void LoadWave(int wave)
Format(g_cZMRoundClasses[i][g_iLength], sizeof(g_cZMRoundClasses), ""); Format(g_cZMRoundClasses[i][g_iLength], sizeof(g_cZMRoundClasses), "");
} }
kv.ImportFromFile(g_cPathsWaveSettings); kv.ImportFromFile(g_cPathsWaveSettings);
kv1.ImportFromFile(g_cPathsWaveSettings);
if (!kv1.JumpToKey(l_cJumptokey1, false))
{
//next wave does not exist, so we reached end wave right now.
//according to the random guy from italy who made his identity smoking weed we force mapvotes on last day and then forcertv when restarting
//from day 1
PrintToChatAll("Reached last day. Initiating the mapvote!");
ServerCommand("sm_mapvote"); //old zombieRiot did this so just copying it
}
if (kv.JumpToKey(l_cJumptokey, false)) if (kv.JumpToKey(l_cJumptokey, false))
{ {
g_bRoundInProgress = true; g_bRoundInProgress = true;
@ -1303,10 +1313,11 @@ public void LoadWave(int wave)
else else
{ {
g_iWave = 1; g_iWave = 1;
PrintToChatAll("Finished last Day! Restarting..."); PrintToChatAll("Finished last Day! Forcing map change...");
CS_TerminateRound(5.0, CSRoundEnd_Draw, true); ServerCommand("sm_forcertv"); //old zombieRiot did this so just copying it
} }
delete kv; delete kv;
delete kv1;
delete l_hFile; delete l_hFile;
} }
//---------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------