From eb19a779a6becd65bcfabfdc49da473537db3b60 Mon Sep 17 00:00:00 2001 From: jenz Date: Mon, 5 Oct 2026 00:30:52 +0200 Subject: [PATCH] adding at most 50 maps to casualpool from playtime session frontend. also assuring they are not on cooldown --- .../scripting/mapchooser_extended_unloze.sp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) 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. }