This commit is contained in:
zaCade 2018-09-18 16:47:47 +02:00
parent 8fad12df8d
commit db13adc4aa

View File

@ -2624,6 +2624,7 @@ stock void InternalRestoreMapCooldowns()
int Cooldown; int Cooldown;
char map[PLATFORM_MAX_PATH]; char map[PLATFORM_MAX_PATH];
do do
{ {
if(!Cooldowns.GetSectionName(map, sizeof(map))) if(!Cooldowns.GetSectionName(map, sizeof(map)))
@ -2655,7 +2656,7 @@ stock void InternalStoreMapCooldowns()
} }
KeyValues Cooldowns = new KeyValues("mapchooser_extended"); KeyValues Cooldowns = new KeyValues("mapchooser_extended");
Cooldowns.Rewind();
int Cooldown; int Cooldown;
char map[PLATFORM_MAX_PATH]; char map[PLATFORM_MAX_PATH];
@ -2668,10 +2669,11 @@ stock void InternalStoreMapCooldowns()
if (!Cooldowns.JumpToKey(map, true)) if (!Cooldowns.JumpToKey(map, true))
{ {
LogMessage("Unable to create/find key: %s", map); LogMessage("Unable to create/find key: %s", map);
delete Cooldowns;
delete OldMapListSnapshot; delete OldMapListSnapshot;
delete Cooldowns;
return; return;
} }
Cooldowns.SetNum("Cooldown", Cooldown); Cooldowns.SetNum("Cooldown", Cooldown);
Cooldowns.Rewind(); Cooldowns.Rewind();
} }
@ -2679,11 +2681,11 @@ stock void InternalStoreMapCooldowns()
if(!Cooldowns.ExportToFile(sCooldownFile)) if(!Cooldowns.ExportToFile(sCooldownFile))
{ {
LogMessage("Unable to export cooldown file: \"%s\"", sCooldownFile); LogMessage("Unable to export cooldown file: \"%s\"", sCooldownFile);
delete Cooldowns;
delete OldMapListSnapshot; delete OldMapListSnapshot;
delete Cooldowns;
return; return;
} }
delete Cooldowns;
delete OldMapListSnapshot; delete OldMapListSnapshot;
delete Cooldowns;
} }