From 9a2d203c0d95e51ea02e3e62fef6289973777e84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Wed, 27 Sep 2017 12:45:07 +0200 Subject: GH-1993 swap min/max memory settings when they are the wrong way around --- application/MultiMC.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'application/MultiMC.cpp') diff --git a/application/MultiMC.cpp b/application/MultiMC.cpp index fd004b05..feaf88a7 100644 --- a/application/MultiMC.cpp +++ b/application/MultiMC.cpp @@ -1125,8 +1125,19 @@ MainWindow* MultiMC::showMainWindow(bool minimized) * cd4 = CPU architecture */ QVariantMap customValues; - customValues["cm1"] = m_settings->get("MinMemAlloc"); - customValues["cm2"] = m_settings->get("MaxMemAlloc"); + int min = m_settings->get("MinMemAlloc").toInt(); + int max = m_settings->get("MaxMemAlloc").toInt(); + if(min < max) + { + customValues["cm1"] = min; + customValues["cm2"] = max; + } + else + { + customValues["cm1"] = max; + customValues["cm2"] = min; + } + constexpr uint64_t Mega = 1024ull * 1024ull; int ramSize = int(Sys::getSystemRam() / Mega); qDebug() << "RAM size is" << ramSize << "MB"; -- cgit v1.2.3