aboutsummaryrefslogtreecommitdiff
path: root/launcher
diff options
context:
space:
mode:
Diffstat (limited to 'launcher')
-rw-r--r--launcher/minecraft/mod/Mod.cpp9
-rw-r--r--launcher/minecraft/mod/Mod.h2
2 files changed, 4 insertions, 7 deletions
diff --git a/launcher/minecraft/mod/Mod.cpp b/launcher/minecraft/mod/Mod.cpp
index 7227fc94..588d76e3 100644
--- a/launcher/minecraft/mod/Mod.cpp
+++ b/launcher/minecraft/mod/Mod.cpp
@@ -147,10 +147,7 @@ void Mod::setStatus(ModStatus status)
if (m_localDetails) {
m_localDetails->status = status;
} else {
- if (!m_temp_status.get())
- m_temp_status.reset(new ModStatus());
-
- *m_temp_status = status;
+ m_temp_status = status;
}
}
void Mod::setMetadata(const Metadata::ModStruct& metadata)
@@ -222,7 +219,7 @@ auto Mod::authors() const -> QStringList
auto Mod::status() const -> ModStatus
{
if (!m_localDetails)
- return m_temp_status ? *m_temp_status : ModStatus::NoMetadata;
+ return m_temp_status;
return details().status;
}
@@ -246,7 +243,7 @@ void Mod::finishResolvingWithDetails(std::shared_ptr<ModDetails> details)
m_resolved = true;
m_localDetails = details;
- setStatus(m_temp_status ? *m_temp_status : ModStatus::NoMetadata);
+ setStatus(m_temp_status);
if (m_localDetails && m_temp_metadata && m_temp_metadata->isValid()) {
setMetadata(*m_temp_metadata);
diff --git a/launcher/minecraft/mod/Mod.h b/launcher/minecraft/mod/Mod.h
index 3d3becd7..7a13e44b 100644
--- a/launcher/minecraft/mod/Mod.h
+++ b/launcher/minecraft/mod/Mod.h
@@ -115,7 +115,7 @@ protected:
std::shared_ptr<Metadata::ModStruct> m_temp_metadata;
/* Set the mod status while it doesn't have local details just yet */
- std::shared_ptr<ModStatus> m_temp_status;
+ ModStatus m_temp_status = ModStatus::NoMetadata;
std::shared_ptr<ModDetails> m_localDetails;