diff --git a/mapchooser_extended/scripting/mapchooser_extended_unloze.sp b/mapchooser_extended/scripting/mapchooser_extended_unloze.sp index 945cae7..fcbb1f9 100755 --- a/mapchooser_extended/scripting/mapchooser_extended_unloze.sp +++ b/mapchooser_extended/scripting/mapchooser_extended_unloze.sp @@ -629,7 +629,6 @@ public void OnTransferComplete(HTTPResponse response, int offset) int count = maps.Length; char mapName[PLATFORM_MAX_PATH]; - int maps_added = 0; for (int i = 0; i < count; i++) { JSONObject entry = view_as(maps.Get(i)); @@ -639,18 +638,28 @@ public void OnTransferComplete(HTTPResponse response, int offset) } entry.GetString("map_name", mapName, sizeof(mapName)); //make sure that the map actually is in the map pool and not admin only or deleted from the server again + //also make sure its not on cooldown right now. + if (InternalGetMapCooldownTime(mapName) > GetTime()) + { + delete entry; + continue; + } if (FindStringInArray(tempMaps, mapName) != -1) { PushArrayString(g_hTopImpactMaps, mapName); - maps_added++; } delete entry; + + if (GetArraySize(g_hTopImpactMaps) >= 50) + { + break; + } } delete tempMaps; delete root; delete maps; - if (maps_added < 45) + if (GetArraySize(g_hTopImpactMaps) < 50) { FillMapsByImpact(offset + 50); //did not get enough maps from the public maplist, set offset to pick the next. }