1
1
Fork 0
forked from suyu/suyu

Merge pull request #11517 from german77/amiibo-format

service: nfc: Fix amiibo formatting
This commit is contained in:
liamwhite 2023-09-16 11:40:26 -04:00 committed by GitHub
commit d26c76180d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -874,17 +874,19 @@ Result NfcDevice::RestoreAmiibo() {
}
Result NfcDevice::Format() {
auto result1 = DeleteApplicationArea();
auto result2 = DeleteRegisterInfo();
Result result = ResultSuccess;
if (result1.IsError()) {
return result1;
if (device_state == DeviceState::TagFound) {
result = Mount(NFP::ModelType::Amiibo, NFP::MountTarget::All);
}
if (result2.IsError()) {
return result2;
if (result.IsError()) {
return result;
}
DeleteApplicationArea();
DeleteRegisterInfo();
return Flush();
}