Permalink
Browse files

SUPERNOVA: Adds explicitly invalid state for Objects

  • Loading branch information...
Joefish committed Aug 26, 2017
1 parent acc3a18 commit 9261b8830a1b81f71f88be43b47d3914344285f0
Showing with 5 additions and 3 deletions.
  1. +3 −2 engines/supernova/msn_def.h
  2. +2 −1 engines/supernova/state.cpp
@@ -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)
@@ -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;

0 comments on commit 9261b88

Please sign in to comment.