DREAMWEB: Minor cleanup

This commit is contained in:
Willem Jan Palenstijn 2011-12-26 17:53:04 +01:00
parent 15bb44dda1
commit 1237004756

View file

@ -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);
}