From f30f34cbdee64a2cf22e1803fb8a165c0f353384 Mon Sep 17 00:00:00 2001 From: Tarek Soliman Date: Tue, 2 May 2017 00:00:00 -0500 Subject: 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 --- engines/sci/engine/guest_additions.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'engines') 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 { -- cgit v1.2.3