Fix for loading savegames from the command line.

svn-id: r26567
This commit is contained in:
Eugene Sandulenko 2007-04-22 16:06:00 +00:00
parent 3f3c7bf7e8
commit 55152e4055
3 changed files with 4 additions and 4 deletions

View file

@ -425,7 +425,7 @@ int AgiEngine::agiInit() {
snprintf (saveNameBuffer, 256, "%s.%03d", _targetName.c_str(), ConfMan.getInt("save_slot"));
loadGame(saveNameBuffer);
loadGame(saveNameBuffer, false); // Do not check game id
}
return ec;

View file

@ -545,7 +545,7 @@ public:
int saveGame(const char *fileName, const char *saveName);
int saveGameDialog();
int saveGameSimple();
int loadGame(const char *fileName);
int loadGame(const char *fileName, bool checkId = true);
int loadGameDialog();
int loadGameSimple();

View file

@ -215,7 +215,7 @@ int AgiEngine::saveGame(const char *fileName, const char *description) {
return errOK;
}
int AgiEngine::loadGame(const char *fileName) {
int AgiEngine::loadGame(const char *fileName, bool checkId) {
char description[31], saveVersion, loadId[8];
int i, vtEntries = MAX_VIEWTABLE;
uint8 t;
@ -251,7 +251,7 @@ int AgiEngine::loadGame(const char *fileName) {
_game.state = in->readByte();
in->read(loadId, 8);
if (strcmp(loadId, _game.id)) {
if (strcmp(loadId, _game.id) && checkId) {
delete in;
warning("This save seems to be from a different AGI game (save from %s, running %s), not loaded", loadId, _game.id);
return errBadFileOpen;