anchor.diff:  end;
   
   
  -//Saves the game in all its glory
  -procedure TKMGame.SaveGameToFile(const aPathName: String; aSaveByPlayer: Boolean; aSaveWorkerThread: TKMWorkerThread;
  -                                 aTimestamp: TDateTime; const aMPLocalDataPathName: String = '');
  -var
  -  mainStream, headerStream, bodyStream, saveStreamTxt: TKMemoryStream;
  -  gameMPLocalData: TKMGameMPLocalData;
  -begin
  -  if BLOCK_SAVE then Exit; // This must be here because of paraller Runner
  -
  -  gLog.AddTime(Format('Saving game at tick %d to ''%s''', [fParams.Tick, aPathName]));
  -
  -  Assert(not fParams.IsMapEditor and (ALLOW_SAVE_IN_REPLAY or not fParams.IsReplay), 'Saving from wrong state');
  -
  -  saveStreamTxt := nil;
  -  if DoSaveGameAsText then
  -    saveStreamTxt := TKMemoryStreamText.Create;
  -
  -  mainStream := TKMemoryStreamBinary.Create(False); // Not compressed
  -  headerStream := TKMemoryStreamBinary.Create(False); // Not compressed
  -  bodyStream := TKMemoryStreamBinary.Create(True);    // Compressed
  -
  -  SaveGameToStream(aTimestamp, headerStream, bodyStream);
  -
  +procedure TKMGame.PrepareSaveFolder(const aPathName: String; aSaveByPlayer: Boolean; aSaveWorkerThread: TKMWorkerThread);
  +var
  +  path: string;
  +begin
  +  path := aPathName;
     //Makes the folders in case they were deleted.
     //Should do before save Minimap file for MP game
     if (aPathName <> '') then
     begin
       // We can make directories in async too, since all save parts are made in async now
       aSaveWorkerThread.QueueWork(procedure
  -    var
  -      path: string;
       begin
  -      path := ExtractFilePath(aPathName);
  +      path := ExtractFilePath(path);
         if DirectoryExists(path) then
         begin
           // Delete save folder content, since we want to overwrite old saves
  
positive.code:   gPerfLogs.SectionEnter(psGameSaveWait);
    {$ENDIF}
    try
      if (aSaveWorkerThread <> fBaseSaveWorkerThreadHolder.Worker) then
        // We have to wait until basesave is made before first game save
        fBaseSaveWorkerThreadHolder.Worker.WaitForAllWorkToComplete;
  
      //Wait for previous save async tasks to complete before proceeding
      aSaveWorkerThread.WaitForAllWorkToComplete;
    finally
      {$IFDEF PERFLOG}
  
negative.code: 
      // Save checkpoints
      if gGameSettings.SaveCheckpoints and not SKIP_SAVE_SAVPTS_TO_FILE then
      begin
        // Prepare
        PrepareSaveFolder(fullPath, saveByPlayer, fSavePointWorkerThreadHolder.Worker);
        // We can save savepoints by our savepoints worker, since we save to the different file anyway
        fSavePoints.SaveToFileAsync(ChangeFileExt(fullPath, EXT_SAVE_GAME_SAVEPTS_DOT), fSavePointWorkerThreadHolder.Worker);
      end;
  
      if DoSaveRandomChecks then
        try
  