diff options
author | Nicola Mettifogo | 2007-02-19 09:31:43 +0000 |
---|---|---|
committer | Nicola Mettifogo | 2007-02-19 09:31:43 +0000 |
commit | 402e364852a915e6aa7e9cd2907b3171e83c41f3 (patch) | |
tree | 2f03583cf5d97115675c24949acef0eefe3f169d /engines/parallaction | |
parent | 880f449a2d969da9b860a995aaf64929ba1b57c5 (diff) | |
download | scummvm-rg350-402e364852a915e6aa7e9cd2907b3171e83c41f3.tar.gz scummvm-rg350-402e364852a915e6aa7e9cd2907b3171e83c41f3.tar.bz2 scummvm-rg350-402e364852a915e6aa7e9cd2907b3171e83c41f3.zip |
fixed engine bug preventing savegames from being consistent with the actual game status. The workaround code comes from BRA.
svn-id: r25715
Diffstat (limited to 'engines/parallaction')
-rw-r--r-- | engines/parallaction/location.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/engines/parallaction/location.cpp b/engines/parallaction/location.cpp index c62e8a8323..b99b5ce937 100644 --- a/engines/parallaction/location.cpp +++ b/engines/parallaction/location.cpp @@ -40,6 +40,7 @@ Node helperNode = { NULL, NULL }; void Parallaction::parseLocation(const char *filename) { // printf("parseLocation(%s)", filename); + debugC(1, kDebugLocation, "parseLocation('%s')", filename); char *location_src = NULL; @@ -93,21 +94,28 @@ void Parallaction::parseLocation(const char *filename) { } else background = _tokens[1]; + + // WORKAROUND: the original code erraneously incremented + // _currentLocationIndex, thus producing inconsistent + // savegames. This workaround modified the following loop + // and if-statement, so the code exactly matches the one + // in Big Red Adventure. _currentLocationIndex = -1; uint16 _di = 0; while (_locationNames[_di][0] != '\0') { if (!scumm_stricmp(_locationNames[_di], filename)) { - _currentLocationIndex = _di + 1; + _currentLocationIndex = _di; } _di++; } if (_currentLocationIndex == -1) { strcpy(_locationNames[_numLocations], filename); - _numLocations++; _currentLocationIndex = _numLocations; + + _numLocations++; _locationNames[_numLocations][0] = '\0'; - _localFlags[_currentLocationIndex] = 0; + _localFlags[_numLocations] = 0; } else { _localFlags[_currentLocationIndex] |= kFlagsVisited; // 'visited' } |