1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2025-01-22 08:49:46 +01:00

Fix editor unexpectedly quitting after failed save-and-quit

Also simplified away the success variable.
This commit is contained in:
Dav999-v 2020-06-02 15:10:23 +02:00 committed by Ethan Lee
parent ae45391ec0
commit 3bb4eefaff

View file

@ -4050,14 +4050,14 @@ void editorinput()
else if(ed.savemod) else if(ed.savemod)
{ {
std::string savestring=ed.filename+".vvvvvv"; std::string savestring=ed.filename+".vvvvvv";
bool success = ed.save(savestring); if (ed.save(savestring))
if (success)
{ {
ed.note="[ Saved map: " + ed.filename+ ".vvvvvv]"; ed.note="[ Saved map: " + ed.filename+ ".vvvvvv]";
} }
else else
{ {
ed.note="[ ERROR: Could not save level! ]"; ed.note="[ ERROR: Could not save level! ]";
ed.saveandquit = false;
} }
ed.notedelay=45; ed.notedelay=45;
ed.savemod=false; ed.savemod=false;
@ -4065,7 +4065,7 @@ void editorinput()
ed.shiftmenu=false; ed.shiftmenu=false;
ed.shiftkey=false; ed.shiftkey=false;
if(ed.saveandquit && success) if(ed.saveandquit)
{ {
//quit editor //quit editor
graphics.fademode = 2; graphics.fademode = 2;
@ -4074,8 +4074,7 @@ void editorinput()
else if(ed.loadmod) else if(ed.loadmod)
{ {
std::string loadstring=ed.filename+".vvvvvv"; std::string loadstring=ed.filename+".vvvvvv";
bool success = ed.load(loadstring); if (ed.load(loadstring))
if (success)
{ {
ed.note="[ Loaded map: " + ed.filename+ ".vvvvvv]"; ed.note="[ Loaded map: " + ed.filename+ ".vvvvvv]";
} }