diff --git a/core/smn_maplists.cpp b/core/smn_maplists.cpp index 4907bf14..640e0570 100644 --- a/core/smn_maplists.cpp +++ b/core/smn_maplists.cpp @@ -524,10 +524,6 @@ private: if ((fp = fopen(pMapList->path, "rt")) == NULL) { - char error_msg[255]; - strncopy(error_msg, "Unknown error", sizeof(error_msg)); - g_LibSys.GetPlatformError(error_msg, sizeof(error_msg)); - g_Logger.LogError("ReadMapList(): Could not open file \"%s\": %s\n", pMapList->path, error_msg); return false; } @@ -658,6 +654,7 @@ static cell_t SetMapListCompatBind(IPluginContext *pContext, const cell_t *param pContext->LocalToString(params[1], &name); pContext->LocalToString(params[2], &file); + s_MapLists.UpdateCache(); s_MapLists.AddOrUpdateDefault(name, file); return 1; diff --git a/plugins/nextmap.sp b/plugins/nextmap.sp index b17159a3..56301872 100644 --- a/plugins/nextmap.sp +++ b/plugins/nextmap.sp @@ -96,19 +96,6 @@ public OnConfigsExecuted() // not in mapcyclefile. So we keep it set to the last expected nextmap. - ferret if (strcmp(lastMap, currentMap) == 0) { - if (ReadMapList(g_MapList, - g_MapListSerial, - "mapcyclefile", - MAPLIST_FLAG_CLEARARRAY|MAPLIST_FLAG_NO_DEFAULT) - == INVALID_HANDLE) - { - if (g_MapListSerial == -1) - { - LogError("FATAL: Cannot load map cycle. Nextmap not loaded."); - SetFailState("Mapcycle Not Found"); - } - } - FindAndSetNextMap(); } } @@ -213,6 +200,10 @@ public Action:UserMsg_VGUIMenu(UserMsg:msg_id, Handle:bf, const players[], playe if (!IsMapValid(map)) { + if (g_MapPos == -1) + { + FindAndSetNextMap(); + } GetArrayString(g_MapList, g_MapPos, map, sizeof(map)); } @@ -244,6 +235,19 @@ public Action:Timer_ChangeMap(Handle:timer, Handle:dp) FindAndSetNextMap() { + if (ReadMapList(g_MapList, + g_MapListSerial, + "mapcyclefile", + MAPLIST_FLAG_CLEARARRAY|MAPLIST_FLAG_NO_DEFAULT) + == INVALID_HANDLE) + { + if (g_MapListSerial == -1) + { + LogError("FATAL: Cannot load map cycle. Nextmap not loaded."); + SetFailState("Mapcycle Not Found"); + } + } + new mapCount = GetArraySize(g_MapList); decl String:mapName[32];