aboutsummaryrefslogtreecommitdiff
path: root/engines/parallaction/parallaction_br.cpp
diff options
context:
space:
mode:
authorNicola Mettifogo2010-06-19 04:50:44 +0000
committerNicola Mettifogo2010-06-19 04:50:44 +0000
commitd7a165b9f256244ed5b4e7f48cea82a540cf1698 (patch)
treefc9fb09744e2f5c17f553f5b8956b75be9962509 /engines/parallaction/parallaction_br.cpp
parent5b3075bd653f888d814abd32b878870c2388668c (diff)
downloadscummvm-rg350-d7a165b9f256244ed5b4e7f48cea82a540cf1698.tar.gz
scummvm-rg350-d7a165b9f256244ed5b4e7f48cea82a540cf1698.tar.bz2
scummvm-rg350-d7a165b9f256244ed5b4e7f48cea82a540cf1698.zip
Implemented PART command for BRA, largely based on patch #3005434 by fuzzie.
svn-id: r50039
Diffstat (limited to 'engines/parallaction/parallaction_br.cpp')
-rw-r--r--engines/parallaction/parallaction_br.cpp22
1 files changed, 18 insertions, 4 deletions
diff --git a/engines/parallaction/parallaction_br.cpp b/engines/parallaction/parallaction_br.cpp
index c752c85d4f..5023a05d85 100644
--- a/engines/parallaction/parallaction_br.cpp
+++ b/engines/parallaction/parallaction_br.cpp
@@ -86,6 +86,7 @@ Common::Error Parallaction_br::init() {
_walker = new PathWalker_BR;
_part = -1;
+ _nextPart = -1;
_subtitle[0] = 0;
_subtitle[1] = 0;
@@ -260,6 +261,8 @@ void Parallaction_br::cleanupGame() {
_globalFlagsNames = 0;
_objectsNames = 0;
_countersNames = 0;
+
+ memset(_zoneFlags, 0, sizeof(_zoneFlags));
}
@@ -272,13 +275,23 @@ void Parallaction_br::changeLocation() {
strcpy(location, _newLocationName.c_str());
char *partStr = strrchr(location, '.');
- if (partStr) {
+ if (partStr || _nextPart != -1) {
cleanupGame();
- int n = partStr - location;
- location[n] = '\0';
+ // more cleanup needed for part changes (see also saveload)
+ _globalFlags = 0;
+ cleanInventory(true);
+ strcpy(_characterName1, "null");
+
+ if (partStr) {
+ int n = partStr - location;
+ location[n] = '\0';
+
+ _part = atoi(++partStr);
+ } else {
+ _part = _nextPart;
+ }
- _part = atoi(++partStr);
if (getFeatures() & GF_DEMO) {
assert(_part == 1);
} else {
@@ -357,6 +370,7 @@ void Parallaction_br::changeLocation() {
_engineFlags &= ~kEngineChangeLocation;
_newLocationName.clear();
+ _nextPart = -1;
}
// FIXME: Parallaction_br::parseLocation() is now a verbatim copy of the same routine from Parallaction_ns.