Make updateSelf a optional boolean.

Should fix sometimes booting into TWiLight Menu++ for some reason.
This commit is contained in:
StackZ
2020-04-28 14:51:37 +02:00
parent 7d8fb7eb5d
commit 0980cc969e
6 changed files with 15 additions and 14 deletions
+1 -6
View File
@@ -1,7 +1,5 @@
#include "cia.hpp"
bool updatingSelf = false;
Result CIA_LaunchTitle(u64 titleId, FS_MediaType mediaType) {
Result ret = 0;
u8 param[0x300];
@@ -67,7 +65,7 @@ FS_MediaType getTitleDestination(u64 titleId) {
// Variables.
u64 installSize = 0, installOffset = 0;
Result installCia(const char * ciaPath)
Result installCia(const char * ciaPath, bool updatingSelf)
{
u32 bytes_read = 0, bytes_written;
installSize = 0, installOffset = 0; u64 size = 0;
@@ -89,9 +87,6 @@ Result installCia(const char * ciaPath)
}
media = getTitleDestination(info.titleID);
if (info.titleID == 0x0004000004391700) {
updatingSelf = true;
}
if (!updatingSelf) {
ret = deletePrevious(info.titleID, media);
+2 -2
View File
@@ -106,12 +106,12 @@ Result ScriptHelper::removeFile(std::string file, std::string message) {
}
// Install a file.
void ScriptHelper::installFile(std::string file, std::string message) {
void ScriptHelper::installFile(std::string file, bool updatingSelf, std::string message) {
snprintf(progressBarMsg, sizeof(progressBarMsg), message.c_str());
showProgressBar = true;
progressBarType = 2;
Threads::create((ThreadFunc)displayProgressBar);
installCia(file.c_str());
installCia(file.c_str(), updatingSelf);
showProgressBar = false;
}