Skip to content

Commit

Permalink
Re-enables OTR patches from mods folder (#1785)
Browse files Browse the repository at this point in the history
* Re-enables OTR patches from mods folder.

* Don't error if an OTR doesn't include a version file

Just info log and continue. If the patch fails to apply then we can error, and SoH can do it's own validation later.

* Fixes small error on my side
  • Loading branch information
leggettc18 authored and Kenix3 committed Jan 3, 2023
1 parent 4fa6a9f commit 016bae2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
7 changes: 3 additions & 4 deletions libultraship/Archive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -448,12 +448,12 @@ namespace Ship {
}
for (int j = i; j < OTRFiles.size(); j++) {
#ifdef _WIN32
std::wstring wfullPath = std::filesystem::absolute(OTRFiles[i]).wstring();
std::wstring wfullPath = std::filesystem::absolute(OTRFiles[j]).wstring();
#endif
#if defined(__SWITCH__)
std::string fullPath = OTRFiles[i];
#else
std::string fullPath = std::filesystem::absolute(OTRFiles[i]).string();
std::string fullPath = std::filesystem::absolute(OTRFiles[j]).string();
#endif
if (LoadPatchMPQ(fullPath, true))
{
Expand Down Expand Up @@ -493,8 +493,7 @@ namespace Ship {
// i.e. Ocarina of Time along with Master Quest.
if (validateVersion) {
if (!PushGameVersion(patchHandle)) {
SPDLOG_WARN("({}) Invalid MQP file.", path.c_str());
return false;
SPDLOG_INFO("({}) Missing version file. Attempting to apply patch anyway.", path.c_str());
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions libultraship/WiiUImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ void ThrowMissingOTR(const char* otrPath) {
OSFatal("Main OTR file not found!");
}

void ThrowInvalidOTR() {
OSFatal("Invalid OTR files! Try regenerating them!");
}

void Update() {
bool rescan = false;

Expand Down
2 changes: 2 additions & 0 deletions libultraship/WiiUImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ void Exit();

void ThrowMissingOTR(const char* otrPath);

void ThrowInvalidOTR();

void Update();

VPADStatus *GetVPADStatus(VPADReadError *error);
Expand Down

0 comments on commit 016bae2

Please sign in to comment.