Explorar el Código

Merge pull request #11517 from german77/amiibo-format

service: nfc: Fix amiibo formatting
liamwhite hace 2 años
padre
commit
d26c76180d
Se han modificado 1 ficheros con 8 adiciones y 6 borrados
  1. 8 6
      src/core/hle/service/nfc/common/device.cpp

+ 8 - 6
src/core/hle/service/nfc/common/device.cpp

@@ -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();
 }