Skip to content

Commit

Permalink
Remove possibly faulty tickets when installing CIAs
Browse files Browse the repository at this point in the history
fixes #685
  • Loading branch information
d0k3 committed Mar 22, 2021
1 parent c209110 commit 1a27dcb
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions arm9/source/utils/gameutil.c
Original file line number Diff line number Diff line change
Expand Up @@ -1985,16 +1985,20 @@ u32 InstallCiaSystemData(CiaStub* cia, const char* drv) {

// title database
if (!InitImgFS(path_titledb) ||
((AddTitleInfoEntryToDB(PART_PATH, title_id, &tie, true)) != 0)) {
(AddTitleInfoEntryToDB(PART_PATH, title_id, &tie, true) != 0)) {
InitImgFS(path_bak);
return 1;
}

// ticket database
if (!InitImgFS(path_ticketdb) ||
((AddTicketToDB(PART_PATH, title_id, (Ticket*) ticket, true)) != 0)) {
InitImgFS(path_bak);
return 1;
(AddTicketToDB(PART_PATH, title_id, (Ticket*) ticket, true) != 0)) {
// workaround for bug #685
RemoveTicketFromDB(PART_PATH, title_id);
if (AddTicketToDB(PART_PATH, title_id, (Ticket*) ticket, true) != 0) {
InitImgFS(path_bak);
return 1;
}
}

// restore old mount path
Expand Down

0 comments on commit 1a27dcb

Please sign in to comment.