anchor.diff:              for i := 1 to units[U].UnitAnim[A,D].Count do
               begin
                 ci := units[U].UnitAnim[A,D].Step[i]+1;
  -              Used[ci] := ci <> 0;
  +              used[ci] := ci <> 0;
               end;
   
         if utSerf in [aUnitFrom..aUnitTo] then
           //serfs carrying stuff
           for R := WARE_MIN to WARE_MAX do
           begin
  -          FolderCreated := False;
  +          folderCreated := False;
             for D := dirN to dirNW do
             begin
  -            Anim := units.SerfCarry[R, D];
  -            for i := 1 to Anim.Count do
  +            anim := units.SerfCarry[R, D];
  +            for i := 1 to anim.Count do
               begin
  -              ci := Anim.Step[i]+1;
  +              ci := anim.Step[i]+1;
                 if ci <> 0 then
                 begin
  -                Used[ci] := True;
  +                used[ci] := True;
                   if utSerf in [aUnitFrom..aUnitTo] then
                   begin
  -                  if not FolderCreated then
  +                  if not folderCreated then
                     begin
                       //Use default locale for Unit GUIName, as translation could be not good for file system (like russian '����������/�������' with slash in it)
  -                    FullFolder := Folder + resTexts.DefaultTexts[units[utSerf].GUITextID] + PathDelim + 'Delivery' + PathDelim
  +                    fullFolderPath := folderPath + resTexts.DefaultTexts[units[utSerf].GUITextID] + PathDelim + 'Delivery' + PathDelim
                                       + GetEnumName(TypeInfo(TKMWareType), Integer(R)) + PathDelim;
  -                    ForceDirectories(FullFolder);
  -                    FolderCreated := True;
  +                    ForceDirectories(fullFolderPath);
  +                    folderCreated := True;
                     end;
  -                  SpritePack.ExportFullImageData(FullFolder, ci, SList);
  +                  spritePack.ExportFullImageData(fullFolderPath, ci, sList);
                     // Stop export if async thread is terminated by application
                     if TThread.CheckTerminated then
                       Exit;
  
positive.code:   // Asynchroniously export data
    GetOrCreateExportWorker.QueueWork(procedure
    var
      FullFolder, Folder: string;
      I, K: Integer;
  
      sprites: TKMResSprites;
      SpriteID: Integer;
      SpritePack: TKMSpritePack;
      SList: TStringList;
    begin
      sprites := TKMResSprites.Create(nil, nil, True);
      sprites.LoadSprites(rxTrees, False);
      SpritePack := sprites[rxTrees];
  
      Folder := ExeDir + 'Export' + PathDelim + 'TreeAnim' + PathDelim;
      ForceDirectories(Folder);
  
      SList := TStringList.Create;
  
      try
        for I := 0 to gRes.MapElements.Count - 1 do
  
negative.code:                 ci := units[U].UnitAnim[A,D].Step[i] + 1;
                  if ci <> 0 then
                  begin
                    if not folderCreated then
                    begin
                      //Use default locale for Unit GUIName, as translation could be not good for file system
                      fullFolderPath := folderPath + resTexts.DefaultTexts[units[U].GUITextID] + PathDelim + UNIT_ACT_STR[A] + PathDelim;
                      ForceDirectories(fullFolderPath);
                      folderCreated := True;
                    end;
                    spritePack.ExportFullImageData(fullFolderPath, ci, sList);
                    // Stop export if async thread is terminated by application
                    if TThread.CheckTerminated then
                      Exit;
  