anchor.diff:    //Similar footer to one in Lewin's Editor, useful so ppl know what mission was made with.
     AddData('//This mission was made with KaM Remake Map Editor version ' + GAME_VERSION + ' at ' + AnsiString(DateTimeToStr(Now)));
   
  -  //Write uncoded file for debug
  -  SaveStream := TFileStream.Create(aFileName+'.txt', fmCreate);
  -  SaveStream.WriteBuffer(SaveString[1], Length(SaveString));
  -  SaveStream.Free;
  -
  -  //Encode it
  -  for I := 1 to Length(SaveString) do
  -    SaveString[I] := AnsiChar(Byte(SaveString[I]) xor 239);
  +
  +  if aDoXorEncoding then
  +  begin
  +    //Write uncoded file for debug
  +    SaveStream := TFileStream.Create(aFileName+'.txt', fmCreate);
  +    SaveStream.WriteBuffer(SaveString[1], Length(SaveString));
  +    SaveStream.Free;
  +
  +    //Encode file
  +    for I := 1 to Length(SaveString) do
  +      SaveString[I] := AnsiChar(Byte(SaveString[I]) xor 239);
  +  end;
   
     SaveStream := TFileStream.Create(aFileName, fmCreate);
     SaveStream.WriteBuffer(SaveString[1], Length(SaveString));
  
positive.code: 
  
  //Write out a KaM format mission file to aFileName
  procedure TMissionParserStandard.SaveDATFile(const aFileName: string);
  const
    COMMANDLAYERS = 4;
  var
  
negative.code:     procedure PostLoadMission;
  
      property DefaultLocation: ShortInt read fDefaultLocation;
      procedure SaveDATFile(const aFileName: string; aDoXorEncoding: Boolean = False);
    end;
  
  
  