diff options
author | Willem Jan Palenstijn | 2011-12-26 17:53:04 +0100 |
---|---|---|
committer | Willem Jan Palenstijn | 2011-12-26 17:53:04 +0100 |
commit | 12370047567e5b1404aafe4c0f37d44bdba8c0b0 (patch) | |
tree | 71820d5bf999fdd6b951995dd462b0c7295b70c1 | |
parent | 15bb44dda15bfeb0762fe39be7b25ab7fcdd0267 (diff) | |
download | scummvm-rg350-12370047567e5b1404aafe4c0f37d44bdba8c0b0.tar.gz scummvm-rg350-12370047567e5b1404aafe4c0f37d44bdba8c0b0.tar.bz2 scummvm-rg350-12370047567e5b1404aafe4c0f37d44bdba8c0b0.zip |
DREAMWEB: Minor cleanup
-rw-r--r-- | engines/dreamweb/object.cpp | 38 |
1 files changed, 10 insertions, 28 deletions
diff --git a/engines/dreamweb/object.cpp b/engines/dreamweb/object.cpp index 2ca7305493..5d0fbab7ee 100644 --- a/engines/dreamweb/object.cpp +++ b/engines/dreamweb/object.cpp @@ -786,13 +786,9 @@ void DreamGenContext::swapWithInv() { ObjectRef subject; subject._type = data.byte(kObjecttype); subject._index = data.byte(kItemframe); - if (subject == _oldSubject) { - if (data.byte(kCommandtype) != 243) { + if (subject != _oldSubject || data.byte(kCommandtype) != 243) { + if (subject == _oldSubject) data.byte(kCommandtype) = 243; - _oldSubject = subject; - commandWithOb(34, subject._type, subject._index); - } - } else { _oldSubject = subject; commandWithOb(34, subject._type, subject._index); } @@ -849,13 +845,9 @@ void DreamGenContext::useOpened() { objectId._type = data.byte(kObjecttype); objectId._index = data.byte(kItemframe); - if (objectId == _oldSubject) { - if (data.byte(kCommandtype) != 227) { + if (objectId != _oldSubject || data.byte(kCommandtype) != 227) { + if (objectId == _oldSubject) data.byte(kCommandtype) = 227; - _oldSubject = objectId; - commandWithOb(35, objectId._type, objectId._index); - } - } else { _oldSubject = objectId; commandWithOb(35, objectId._type, objectId._index); } @@ -905,13 +897,9 @@ void DreamGenContext::outOfOpen() { return; } - if (objectId == _oldSubject) { - if (data.byte(kCommandtype) != 228) { + if (objectId != _oldSubject || data.byte(kCommandtype) != 228) { + if (objectId == _oldSubject) data.byte(kCommandtype) = 228; - _oldSubject = objectId; - commandWithOb(36, objectId._type, objectId._index); - } - } else { _oldSubject = objectId; commandWithOb(36, objectId._type, objectId._index); } @@ -920,10 +908,8 @@ void DreamGenContext::outOfOpen() { return; // notletgo4 if (data.word(kMousebutton) != 1) { - if (data.word(kMousebutton) != 2) - return; // notletgo4 - - reExFromOpen(); + if (data.word(kMousebutton) == 2) + reExFromOpen(); return; } @@ -955,13 +941,9 @@ void DreamGenContext::swapWithOpen() { ObjectRef subject; subject._type = data.byte(kObjecttype); subject._index = data.byte(kItemframe); - if (subject == _oldSubject) { - if (data.byte(kCommandtype) != 242) { + if (subject != _oldSubject || data.byte(kCommandtype) != 242) { + if (subject == _oldSubject) data.byte(kCommandtype) = 242; - _oldSubject = subject; - commandWithOb(34, subject._type, subject._index); - } - } else { _oldSubject = subject; commandWithOb(34, subject._type, subject._index); } |