diff options
author | Thierry Crozat | 2017-11-06 23:54:32 +0000 |
---|---|---|
committer | Thierry Crozat | 2018-01-23 02:15:38 +0000 |
commit | 909818c7301998738f04014fa0cbbf44d7a830c8 (patch) | |
tree | f54ca22b10d10eaf94411e7522c5f6973f0e2284 | |
parent | ba4e20b80a416132794238b9cb518a67fc9eb57e (diff) | |
download | scummvm-rg350-909818c7301998738f04014fa0cbbf44d7a830c8.tar.gz scummvm-rg350-909818c7301998738f04014fa0cbbf44d7a830c8.tar.bz2 scummvm-rg350-909818c7301998738f04014fa0cbbf44d7a830c8.zip |
SUPERNOVA: Fix combining ObjectType enum values
It was storing the result of bitwise operation on the ObjectType
enum values in a ObjectType variable. But that was incorrect as
the result was not a value from the enum.
Also removing a property was actually adding the property if it
was not present in the value initially.
-rw-r--r-- | engines/supernova/msn_def.h | 5 | ||||
-rw-r--r-- | engines/supernova/state.cpp | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/engines/supernova/msn_def.h b/engines/supernova/msn_def.h index 0cca058bba..eda835eb75 100644 --- a/engines/supernova/msn_def.h +++ b/engines/supernova/msn_def.h @@ -330,6 +330,7 @@ enum ObjectType { OCCUPIED = 2048, CAUGHT = 4096 }; +typedef uint16 ObjectTypes; enum Action { ACTION_WALK, @@ -613,7 +614,7 @@ struct Object { } void disableProperty(ObjectType type) { - _type ^= type; + _type &= ~type; } bool hasProperty(ObjectType type) const { @@ -632,7 +633,7 @@ struct Object { StringID _name; StringID _description; ObjectID _id; - ObjectType _type; + ObjectTypes _type; byte _click; byte _click2; byte _section; diff --git a/engines/supernova/state.cpp b/engines/supernova/state.cpp index 650518168f..11ffd27d4a 100644 --- a/engines/supernova/state.cpp +++ b/engines/supernova/state.cpp @@ -527,7 +527,7 @@ void GameManager::processInput() { if (((_mouseField >= 0) && (_mouseField < 256)) || ((_mouseField >= 512) && (_mouseField < 768))) { _inputObject[0] = _currentInputObject; - ObjectType type = _inputObject[0]->_type; + ObjectTypes type = _inputObject[0]->_type; if (type & OPENABLE) { if (type & OPENED) _inputVerb = ACTION_CLOSE; |