diff --git a/ZombieRiot/scripting/unloze_zr.sp b/ZombieRiot/scripting/unloze_zr.sp index 556e01df..3d4a8275 100644 --- a/ZombieRiot/scripting/unloze_zr.sp +++ b/ZombieRiot/scripting/unloze_zr.sp @@ -1130,6 +1130,7 @@ public Action Timer_switchingModel(Handle timer, any data) public void LoadWave(int wave) { KeyValues kv = CreateKeyValues("Waves"); + KeyValues kv1 = CreateKeyValues("Waves"); int l_iBotQuote; char l_cJumptokey[16]; char l_cJumptokey1[16]; @@ -1146,6 +1147,15 @@ public void LoadWave(int wave) Format(g_cZMRoundClasses[i][g_iLength], sizeof(g_cZMRoundClasses), ""); } 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)) { g_bRoundInProgress = true; @@ -1303,10 +1313,11 @@ public void LoadWave(int wave) else { g_iWave = 1; - PrintToChatAll("Finished last Day! Restarting..."); - CS_TerminateRound(5.0, CSRoundEnd_Draw, true); + PrintToChatAll("Finished last Day! Forcing map change..."); + ServerCommand("sm_forcertv"); //old zombieRiot did this so just copying it } delete kv; + delete kv1; delete l_hFile; } //----------------------------------------------------------------------------------------------------