aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph-Eugene Winzer2017-08-26 06:51:46 +0200
committerThierry Crozat2018-01-23 01:47:02 +0000
commit63c62d25e11a82988efb11186309db1ef98b5903 (patch)
tree577649c86692d53e756374770c29f817d4c5c4ce
parentb948a53f2ff69a2139e4377aa103f77de68d6c29 (diff)
downloadscummvm-rg350-63c62d25e11a82988efb11186309db1ef98b5903.tar.gz
scummvm-rg350-63c62d25e11a82988efb11186309db1ef98b5903.tar.bz2
scummvm-rg350-63c62d25e11a82988efb11186309db1ef98b5903.zip
SUPERNOVA: Adds explicitly invalid state for Objects
-rw-r--r--engines/supernova/msn_def.h5
-rw-r--r--engines/supernova/state.cpp3
2 files changed, 5 insertions, 3 deletions
diff --git a/engines/supernova/msn_def.h b/engines/supernova/msn_def.h
index cf85efce0c..3b2bd494cb 100644
--- a/engines/supernova/msn_def.h
+++ b/engines/supernova/msn_def.h
@@ -382,7 +382,8 @@ enum RoomID {
};
enum ObjectID {
- NULLOBJECT,
+ INVALIDOBJECT = -1,
+ NULLOBJECT = 0,
KEYCARD,KNIFE,WATCH,
SOCKET,
BUTTON,HATCH1,
@@ -463,7 +464,7 @@ struct Object {
Object()
: _name("")
, _description(Object::defaultDescription)
- , _id(NULLOBJECT)
+ , _id(INVALIDOBJECT)
, _type(NULLTYPE)
, _click(0)
, _click2(0)
diff --git a/engines/supernova/state.cpp b/engines/supernova/state.cpp
index d236019adf..521f90b53d 100644
--- a/engines/supernova/state.cpp
+++ b/engines/supernova/state.cpp
@@ -458,7 +458,8 @@ void GameManager::processInput() {
}
/* normal item */
else {
- for (int i = 0; (_currentRoom->getObject(i)->_name.c_str()[0] != '\0') && (field == -1) && i < kMaxObject; i++) {
+ for (int i = 0; (_currentRoom->getObject(i)->_id != INVALIDOBJECT) &&
+ (field == -1) && i < kMaxObject; i++) {
click = _currentRoom->getObject(i)->_click;
if (click != 255) {
MSNImageDecoder::ClickField *clickField = _vm->_currentImage->_clickField;