diff options
-rw-r--r-- | sword2/controls.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sword2/controls.cpp b/sword2/controls.cpp index 4dc5b65f91..81456c84ed 100644 --- a/sword2/controls.cpp +++ b/sword2/controls.cpp @@ -1378,8 +1378,6 @@ void SaveRestoreDialog::setResult(int result) { if (_mode == kSaveDialog) { if (_editPos <= _firstPos) return; - - _editBuffer[_editPos] = 0; } } @@ -1387,12 +1385,14 @@ void SaveRestoreDialog::setResult(int result) { } int SaveRestoreDialog::runModal() { - int result = Dialog::runModal(); if (result) { switch (_mode) { case kSaveDialog: + // Remove the cursor character from the savegame name + _editBuffer[_editPos] = 0; + if (_vm->saveGame(_selectedSlot, (byte *)&_editBuffer[_firstPos]) != SR_OK) result = 0; break; |