/*
-Copyright (C) 2004-2010 Parallel Realities
+Copyright (C) 2004-2011 Parallel Realities
+Copyright (C) 2011-2015 Perpendicular Dimensions
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
if (fread(&game, sizeof(Game), 1, fp) != 1)
{
fclose(fp);
- graphics.showErrorAndExit("The save data loaded was not in the format expected", "");
+ return graphics.showErrorAndExit("The save data loaded was not in the format expected", ""), false;
}
fclose(fp);
{
if (!fgets(line, 1024, fp)) {
fclose(fp);
- graphics.showErrorAndExit("Unexpected end of file reading save data", "");
+ return graphics.showErrorAndExit("Unexpected end of file reading save data", ""), false;
}
sscanf(line, "%*c %[^\"] %*c %*c %[^\"] %*c %d %d", string[0], string[1], ¶m[0], ¶m[1]);
if (!fp)
{
- graphics.showErrorAndExit("File write error whilst saving game", "");
+ return graphics.showErrorAndExit("File write error whilst saving game", "");
}
if (fwrite(&game, sizeof(Game), 1, fp) != 1)
{
fclose(fp);
- graphics.showErrorAndExit("File write error whilst saving game", strerror(errno));
+ return graphics.showErrorAndExit("File write error whilst saving game", strerror(errno));
}
fclose(fp);
if (!fp)
{
- graphics.showErrorAndExit("File write error whilst saving game", "");
+ return graphics.showErrorAndExit("File write error whilst saving game", "");
}
createPersistantMapData();