[Scummvm-cvs-logs] SF.net SVN: scummvm: [25715] scummvm/trunk/engines/parallaction/location. cpp
peres001 at users.sourceforge.net
peres001 at users.sourceforge.net
Mon Feb 19 10:31:44 CET 2007
Revision: 25715
http://scummvm.svn.sourceforge.net/scummvm/?rev=25715&view=rev
Author: peres001
Date: 2007-02-19 01:31:43 -0800 (Mon, 19 Feb 2007)
Log Message:
-----------
fixed engine bug preventing savegames from being consistent with the actual game status. The workaround code comes from BRA.
Modified Paths:
--------------
scummvm/trunk/engines/parallaction/location.cpp
Modified: scummvm/trunk/engines/parallaction/location.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/location.cpp 2007-02-19 09:25:11 UTC (rev 25714)
+++ scummvm/trunk/engines/parallaction/location.cpp 2007-02-19 09:31:43 UTC (rev 25715)
@@ -40,6 +40,7 @@
void Parallaction::parseLocation(const char *filename) {
// printf("parseLocation(%s)", filename);
+ debugC(1, kDebugLocation, "parseLocation('%s')", filename);
char *location_src = NULL;
@@ -93,21 +94,28 @@
} 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);
+ _currentLocationIndex = _numLocations;
+
_numLocations++;
- _currentLocationIndex = _numLocations;
_locationNames[_numLocations][0] = '\0';
- _localFlags[_currentLocationIndex] = 0;
+ _localFlags[_numLocations] = 0;
} else {
_localFlags[_currentLocationIndex] |= kFlagsVisited; // 'visited'
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list