ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/oup/current/DataAccess/Access_OniArchive.pas
(Generate patch)

Comparing oup/current/DataAccess/Access_OniArchive.pas (file contents):
Revision 230 by alloc, Wed Jun 20 10:57:51 2007 UTC vs.
Revision 231 by alloc, Wed Jun 20 22:24:04 2007 UTC

# Line 369 | Line 369 | var
369   begin
370    if fileid < GetFileCount then
371    begin
372 <    if not Assigned(Target) then
373 <      Target := TMemoryStream.Create;
374 <    if not FDatOpened then
375 <      Fdat_file := TFileStream.Create(FFileName, fmOpenReadWrite);
376 <    Fdat_file.Seek(Fdat_files[fileid].DatAddr, soFromBeginning);
377 <    streampos := Target.Position;
378 <    Target.CopyFrom(Fdat_file, Fdat_files[fileid].Size);
379 <    Target.Seek(streampos, soFromBeginning);
380 <    if UnloadWhenUnused then
372 >    if GetFileInfo(FileID).Size > 0 then
373      begin
374 <      Fdat_file.Free;
375 <      FDatOpened := False;
376 <    end
377 <    else
378 <      FDatOpened := True;
374 >      if not Assigned(Target) then
375 >        Target := TMemoryStream.Create;
376 >      if not FDatOpened then
377 >        Fdat_file := TFileStream.Create(FFileName, fmOpenReadWrite);
378 >      Fdat_file.Seek(Fdat_files[fileid].DatAddr, soFromBeginning);
379 >      streampos := Target.Position;
380 >      Target.CopyFrom(Fdat_file, Fdat_files[fileid].Size);
381 >      Target.Seek(streampos, soFromBeginning);
382 >      if UnloadWhenUnused then
383 >      begin
384 >        Fdat_file.Free;
385 >        FDatOpened := False;
386 >      end
387 >      else
388 >        FDatOpened := True;
389 >    end;
390    end;
391   end;
392  

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)