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