aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorTarek Soliman2017-05-02 00:00:00 -0500
committerTarek Soliman2017-05-05 12:38:04 -0500
commitf30f34cbdee64a2cf22e1803fb8a165c0f353384 (patch)
treed4ca4a237d0a6912218269cf9e666d2bf70117e9 /engines
parent8d94a046052bc5c041831a77b2a9a8b59e1f527e (diff)
downloadscummvm-rg350-f30f34cbdee64a2cf22e1803fb8a165c0f353384.tar.gz
scummvm-rg350-f30f34cbdee64a2cf22e1803fb8a165c0f353384.tar.bz2
scummvm-rg350-f30f34cbdee64a2cf22e1803fb8a165c0f353384.zip
SCI32: Set a savegame description if none was entered
This fixes the the SCI32 incarnation of Trac#5343 (defect#3061964): Savegames with no name can't be restored
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/engine/guest_additions.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/engines/sci/engine/guest_additions.cpp b/engines/sci/engine/guest_additions.cpp
index 6ed2cd901a..f52bffd16a 100644
--- a/engines/sci/engine/guest_additions.cpp
+++ b/engines/sci/engine/guest_additions.cpp
@@ -429,7 +429,10 @@ reg_t GuestAdditions::promptSaveRestoreDefault(EngineState *s, int argc, reg_t *
descriptionId = argv[0];
}
SciArray &description = *_segMan->lookupArray(descriptionId);
- description.fromString(dialog.getResultString());
+ Common::String descriptionString = dialog.getResultString();
+ if (descriptionString.empty())
+ descriptionString = dialog.createDefaultSaveDescription(saveNo - 1);
+ description.fromString(descriptionString);
}
} else {
if (s->_delayedRestoreGameId != -1) {
@@ -463,7 +466,10 @@ reg_t GuestAdditions::promptSaveRestoreTorin(EngineState *s, int argc, reg_t *ar
reg_t descriptionId = s->variables[VAR_LOCAL][1];
reg_t dataId;
SciArray &description = *_segMan->allocateArray(kArrayTypeString, 0, &dataId);
- description.fromString(dialog.getResultString());
+ Common::String descriptionString = dialog.getResultString();
+ if (descriptionString.empty())
+ descriptionString = dialog.createDefaultSaveDescription(saveNo - 1);
+ description.fromString(descriptionString);
writeSelector(_segMan, descriptionId, SELECTOR(data), dataId);
}
} else {