From bc3c68c5088a39cf2befe5fba5bb2056643c4b4f Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sun, 25 Sep 2011 18:39:22 +0300 Subject: 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. --- engines/agi/agi.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'engines/agi') 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 -- cgit v1.2.3