mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-29 17:38:16 +03:00
Fix editor unexpectedly quitting after failed save-and-quit
Also simplified away the success variable.
This commit is contained in:
@@ -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]";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user