diff --git a/doc_construct.cpp b/doc_construct.cpp index 24505f64..b414606d 100644 --- a/doc_construct.cpp +++ b/doc_construct.cpp @@ -664,80 +664,6 @@ BOOL CMUSHclientDoc::OnNewDocument() SetDefaults (false); // set up numeric/boolean defaults SetAlphaDefaults (false); // set up alpha defaults - if (App.m_TypeOfNewDocument == App.eNormalNewDocument) // only ask on normal new world - { - int i = ::TMessageBox ("Preload world defaults from an existing world?", - MB_YESNOCANCEL | MB_ICONQUESTION); - - if (i == IDCANCEL) - return FALSE; - - if (i == IDYES) - while (TRUE) // loop until successful read of file, or cancel - { - // Get file - CString strFilter(MAKEINTRESOURCE(IDS_OPEN_WORLD_FILTER)); - CString strTitle(MAKEINTRESOURCE(IDS_OPEN_WORLD_TITLE)); - CFileDialog dlg(TRUE, // TRUE for FileOpen - NULL, // default extension - NULL, // no initial file name - OFN_HIDEREADONLY|OFN_FILEMUSTEXIST, - strFilter); - dlg.m_ofn.lpstrTitle = strTitle; - - // use default world file directory - dlg.m_ofn.lpstrInitialDir = Make_Absolute_Path (App.m_strDefaultWorldFileDirectory); - - ChangeToFileBrowsingDirectory (); - int nResult = dlg.DoModal(); - ChangeToStartupDirectory (); - - if (nResult != IDOK) - break; - CString strFileName = dlg.GetPathName(); - - CWaitCursor wait; - - try - { - - // Open existing world file - CFile fileWorld(strFileName, CFile::modeRead|CFile::shareDenyWrite); - - CArchive ar(&fileWorld, CArchive::load); - - try - { - Serialize (ar); - } - catch(CException* e) - { - ::TMessageBox ("Unexpected file format - invalid world file", MB_ICONEXCLAMATION); - e->Delete(); - ar.Close(); - continue; - } - - ar.Close(); - - } - catch(CException* e) - { - ::TMessageBox ("Unable to open world file", MB_ICONEXCLAMATION); - e->Delete(); - continue; - } - - // if we got here, we successfully loaded the world! - - SetModifiedFlag (); - m_strWorldID = GetUniqueID (); // new world ID - - break; - - } // end of preloading defaults - } // end of normal new world - // if defaults are wanted, overwrite what we loaded with them :) if (m_bLoaded) diff --git a/xml/xml_serialize.cpp b/xml/xml_serialize.cpp index af3df150..deff7975 100644 --- a/xml/xml_serialize.cpp +++ b/xml/xml_serialize.cpp @@ -46,7 +46,7 @@ void CMUSHclientDoc::Serialize_World_XML (CArchive& ar) m_CurrentPlugin = pSavedPlugin; } else - { // loaidng + { // loading Load_World_XML (ar, (unsigned long) ~(XML_PLUGINS | XML_NO_PLUGINS)); // load all options, except plugins m_bLoaded = true; // this world has been loaded from disk }