NOISSUE fix launching offline while online

This commit is contained in:
Petr Mrázek 2021-12-06 20:17:31 +01:00
parent 825ef52dd5
commit a5581b479e

View File

@ -117,31 +117,34 @@ void LaunchController::login() {
switch(m_accountToUse->accountState()) {
case AccountState::Offline: {
// we ask the user for a player name
bool ok = false;
QString usedname = m_session->player_name;
QString name = QInputDialog::getText(
m_parentWidget,
tr("Player name"),
tr("Choose your offline mode player name."),
QLineEdit::Normal,
m_session->player_name,
&ok
);
if (!ok)
{
tryagain = false;
break;
}
if (name.length())
{
usedname = name;
}
m_session->MakeOffline(usedname);
// offline flavored game from here :3
m_session->wants_online = false;
// NOTE: fallthrough is intentional
}
case AccountState::Online: {
if(!m_session->wants_online) {
// we ask the user for a player name
bool ok = false;
QString usedname = m_session->player_name;
QString name = QInputDialog::getText(
m_parentWidget,
tr("Player name"),
tr("Choose your offline mode player name."),
QLineEdit::Normal,
m_session->player_name,
&ok
);
if (!ok)
{
tryagain = false;
break;
}
if (name.length())
{
usedname = name;
}
m_session->MakeOffline(usedname);
// offline flavored game from here :3
}
if(m_accountToUse->ownsMinecraft() && !m_accountToUse->hasProfile()) {
auto entitlement = m_accountToUse->accountData()->minecraftEntitlement;
QString errorString;