diff options
author | Filippos Karapetis | 2011-09-25 18:39:22 +0300 |
---|---|---|
committer | Filippos Karapetis | 2011-09-25 18:39:22 +0300 |
commit | bc3c68c5088a39cf2befe5fba5bb2056643c4b4f (patch) | |
tree | 8cbe3b5f324256b157abcd61132fd3e5d66b3d7e /engines/agi | |
parent | 07790184843c5b2f47a09eedf184121b5438e8c0 (diff) | |
download | scummvm-rg350-bc3c68c5088a39cf2befe5fba5bb2056643c4b4f.tar.gz scummvm-rg350-bc3c68c5088a39cf2befe5fba5bb2056643c4b4f.tar.bz2 scummvm-rg350-bc3c68c5088a39cf2befe5fba5bb2056643c4b4f.zip |
AGI: Fixed bug #3292784 - "AGI: SQ2: Name forgotten after game restart"
The string buffer should not be cleared on game restart, as game scripts
depend on it being maintained unchanged during restart.
Diffstat (limited to 'engines/agi')
-rw-r--r-- | engines/agi/agi.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/engines/agi/agi.cpp b/engines/agi/agi.cpp index 4bebf97e95..3a79f02cb6 100644 --- a/engines/agi/agi.cpp +++ b/engines/agi/agi.cpp @@ -362,9 +362,15 @@ int AgiEngine::agiInit() { initPriTable(); - // clear string buffer - for (i = 0; i < MAX_STRINGS; i++) - _game.strings[i][0] = 0; + // Clear the string buffer on startup, but not when the game restarts, as + // some scripts expect that the game strings remain unaffected after a + // restart. An example is script 98 in SQ2, which is not invoked on restart + // to ask Ego's name again. The name is supposed to be maintained in string 1. + // Fixes bug #3292784. + if (!_restartGame) { + for (i = 0; i < MAX_STRINGS; i++) + _game.strings[i][0] = 0; + } // setup emulation |