bool MainFrame::DoQueryClose() { Editor* editor = gui.GetCurrentEditor(); if(editor) { if(editor->IsLive()) { long ret = gui.PopupDialog( wxT("Must Close Server"), wxString(wxT("You are currently connected to a live server, to close this map the connection must be severed.")), wxOK | wxCANCEL); if(ret == wxID_OK) { editor->CloseLiveServer(); } else { return false; } } } return true; }