aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorFilippos Karapetis2011-09-25 18:39:22 +0300
committerFilippos Karapetis2011-09-25 18:39:22 +0300
commitbc3c68c5088a39cf2befe5fba5bb2056643c4b4f (patch)
tree8cbe3b5f324256b157abcd61132fd3e5d66b3d7e /engines
parent07790184843c5b2f47a09eedf184121b5438e8c0 (diff)
downloadscummvm-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')
-rw-r--r--engines/agi/agi.cpp12
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