From db13adc4aa890c0a8d97e6f6bf7473efa0177ed9 Mon Sep 17 00:00:00 2001 From: zaCade Date: Tue, 18 Sep 2018 16:47:47 +0200 Subject: [PATCH] =?UTF-8?q?=E0=B2=A0=5F=E0=B2=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mapchooser_extended/scripting/mapchooser_extended.sp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/mapchooser_extended/scripting/mapchooser_extended.sp b/mapchooser_extended/scripting/mapchooser_extended.sp index eb9ea5bf..2b6c998a 100644 --- a/mapchooser_extended/scripting/mapchooser_extended.sp +++ b/mapchooser_extended/scripting/mapchooser_extended.sp @@ -2624,6 +2624,7 @@ stock void InternalRestoreMapCooldowns() int Cooldown; char map[PLATFORM_MAX_PATH]; + do { if(!Cooldowns.GetSectionName(map, sizeof(map))) @@ -2655,7 +2656,7 @@ stock void InternalStoreMapCooldowns() } KeyValues Cooldowns = new KeyValues("mapchooser_extended"); - Cooldowns.Rewind(); + int Cooldown; char map[PLATFORM_MAX_PATH]; @@ -2668,10 +2669,11 @@ stock void InternalStoreMapCooldowns() if (!Cooldowns.JumpToKey(map, true)) { LogMessage("Unable to create/find key: %s", map); - delete Cooldowns; delete OldMapListSnapshot; + delete Cooldowns; return; } + Cooldowns.SetNum("Cooldown", Cooldown); Cooldowns.Rewind(); } @@ -2679,11 +2681,11 @@ stock void InternalStoreMapCooldowns() if(!Cooldowns.ExportToFile(sCooldownFile)) { LogMessage("Unable to export cooldown file: \"%s\"", sCooldownFile); - delete Cooldowns; delete OldMapListSnapshot; + delete Cooldowns; return; } - delete Cooldowns; delete OldMapListSnapshot; + delete Cooldowns; } \ No newline at end of file