Skip to content

Commit

Permalink
properly fail if the file is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
cheat-engine committed Aug 30, 2017
1 parent 8bf47e3 commit 7ee6e30
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Cheat Engine/frmExeTrainerGeneratorUnit.pas
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ implementation
rsDECOMPRESSOR = ' DECOMPRESSOR:';
rsInvalidIcon = '(Invalid icon)';
rsInvalidIconType = '(Invalid icon type)';
rsTrainerFileMissing = 'Copying %s.dat to %s failed. Please make sure the '
+'file still exists';

procedure TfrmExeTrainerGenerator.FormActivate(Sender: TObject);
begin
Expand Down Expand Up @@ -479,8 +481,13 @@ procedure TfrmExeTrainerGenerator.btnGenerateTrainerClick(Sender: TObject);
end;
end else raise exception.create(
rsFailureOpeningTheTrainerForResourceUpdates);
end;
showmessage(rsTheTrainerHasBeenSuccessfullyGenerated);

showmessage(rsTheTrainerHasBeenSuccessfullyGenerated);
end
else
showMessage(Format(rsTrainerFileMissing, [cheatenginedir+basefile, filename]));


finally
if _archive<>nil then
freeandnil(_archive);
Expand Down

0 comments on commit 7ee6e30

Please sign in to comment.