diff options
author | Nicola Mettifogo | 2009-03-28 14:17:17 +0000 |
---|---|---|
committer | Nicola Mettifogo | 2009-03-28 14:17:17 +0000 |
commit | f2d7875db66b8c89a3f6786335045c05a36a1d07 (patch) | |
tree | 3cddffaa1f5a30b5419958437a77c4073467a2e7 /engines | |
parent | a9f5340cbaea79c12f66e0f50c82ab44c037752f (diff) | |
download | scummvm-rg350-f2d7875db66b8c89a3f6786335045c05a36a1d07.tar.gz scummvm-rg350-f2d7875db66b8c89a3f6786335045c05a36a1d07.tar.bz2 scummvm-rg350-f2d7875db66b8c89a3f6786335045c05a36a1d07.zip |
Added initialization for _index and _locationIndex in Zone objects.
svn-id: r39723
Diffstat (limited to 'engines')
-rw-r--r-- | engines/parallaction/objects.cpp | 3 | ||||
-rw-r--r-- | engines/parallaction/objects.h | 3 | ||||
-rw-r--r-- | engines/parallaction/parallaction_br.cpp | 4 |
3 files changed, 9 insertions, 1 deletions
diff --git a/engines/parallaction/objects.cpp b/engines/parallaction/objects.cpp index 8358a20ad2..9c6d3cb96c 100644 --- a/engines/parallaction/objects.cpp +++ b/engines/parallaction/objects.cpp @@ -184,7 +184,8 @@ Zone::Zone() { _label = 0; // BRA specific - _index = 0; + _index = INVALID_ZONE_INDEX; + _locationIndex = INVALID_LOCATION_INDEX; _linkedName = 0; } diff --git a/engines/parallaction/objects.h b/engines/parallaction/objects.h index 4eabf08720..393913edeb 100644 --- a/engines/parallaction/objects.h +++ b/engines/parallaction/objects.h @@ -266,6 +266,9 @@ struct TypeData { #define ZONENAME_LENGTH 32 +#define INVALID_LOCATION_INDEX ((uint32)-1) +#define INVALID_ZONE_INDEX ((uint32)-1) + struct Zone { private: int16 _right; diff --git a/engines/parallaction/parallaction_br.cpp b/engines/parallaction/parallaction_br.cpp index 87aa8289ab..0cd89bf647 100644 --- a/engines/parallaction/parallaction_br.cpp +++ b/engines/parallaction/parallaction_br.cpp @@ -486,6 +486,10 @@ void Parallaction_br::setFollower(const Common::String &name) { } void Parallaction_br::restoreOrSaveZoneFlags(ZonePtr z, bool restore) { + if ((z->_locationIndex == INVALID_LOCATION_INDEX) || (z->_index == INVALID_ZONE_INDEX)) { + return; + } + if (restore) { z->_flags = _zoneFlags[z->_locationIndex][z->_index]; } else { |