Fail and warn if an amiibo is loaded at the wrong time

This commit is contained in:
wheremyfoodat 2023-09-09 01:52:28 +03:00
parent 72ae5d2bfa
commit cf54fd6d1d
2 changed files with 12 additions and 0 deletions

View file

@ -48,6 +48,13 @@ void NFCService::handleSyncRequest(u32 messagePointer) {
bool NFCService::loadAmiibo(const std::filesystem::path& path) {
IOFile file(path, "rb");
if (!initialized || tagStatus != TagStatus::Scanning) {
Helpers::warn("It's not the correct time to load an amiibo! Make sure to load amiibi when the game is searching for one!");
file.close();
return false;
}
if (!file.isOpen()) {
printf("Failed to open Amiibo file");
file.close();