diff --git a/src/SaveTool/SaveTool_MainManager.cpp b/src/SaveTool/SaveTool_MainManager.cpp index c0242e4..224ebe4 100644 --- a/src/SaveTool/SaveTool_MainManager.cpp +++ b/src/SaveTool/SaveTool_MainManager.cpp @@ -161,8 +161,10 @@ auto SaveTool::drawRenamePopup(Containers::ArrayView name_view) -> bool { ImGuiInputTextFlags_CallbackCharFilter, callback, nullptr); ImGui::SameLine(); - if((!_unsafeMode && _mbManager->gameState() != GameState::NotRunning) || - !(len >= 6 && len <= 32) || !(name_view[0] != ' ' && name_view[len - 1] != ' ')) + GameState game_state = _mbManager->gameState(); + if((!_unsafeMode && game_state != GameState::NotRunning) || + !(len >= 6 && len <= 32) || + !(name_view[0] != ' ' && name_view[len - 1] != ' ')) { ImGui::PushItemFlag(ImGuiItemFlags_Disabled, true); ImGui::PushStyleVar(ImGuiStyleVar_Alpha, 0.5f); @@ -173,8 +175,9 @@ auto SaveTool::drawRenamePopup(Containers::ArrayView name_view) -> bool { ImGui::CloseCurrentPopup(); } - if((!_unsafeMode && _mbManager->gameState() != GameState::NotRunning) || - !(len >= 6 && len <= 32) || !(name_view[0] != ' ' && name_view[len - 1] != ' ')) + if((!_unsafeMode && game_state != GameState::NotRunning) || + !(len >= 6 && len <= 32) || + !(name_view[0] != ' ' && name_view[len - 1] != ' ')) { ImGui::PopItemFlag(); ImGui::PopStyleVar();