SCUMM: Made some potentially ambiguous (to the reader, at least) checks slightly less ambiguous

svn-id: r33919
This commit is contained in:
Max Horn 2008-08-15 22:06:15 +00:00
parent 7891e5afce
commit f2111eeb45
2 changed files with 11 additions and 11 deletions

View file

@ -544,8 +544,8 @@ bool ScummEngine::checkXYInBoxBounds(int boxnum, int x, int y) {
// Corner case: If the box is a simple line segment, we consider the // Corner case: If the box is a simple line segment, we consider the
// point to be contained "in" (or rather, lying on) the line if it // point to be contained "in" (or rather, lying on) the line if it
// is very close to its projection to the line segment. // is very close to its projection to the line segment.
if (box.ul == box.ur && box.lr == box.ll || if ((box.ul == box.ur && box.lr == box.ll) ||
box.ul == box.ll && box.ur == box.lr) { (box.ul == box.ll && box.ur == box.lr)) {
Common::Point tmp; Common::Point tmp;
tmp = closestPtOnLine(box.ul, box.lr, p); tmp = closestPtOnLine(box.ul, box.lr, p);
@ -803,8 +803,8 @@ bool Actor::findPathTowards(byte box1nr, byte box2nr, byte box3nr, Common::Point
} }
if (box1.ul.y > box2.ur.y || box2.ul.y > box1.ur.y || if (box1.ul.y > box2.ur.y || box2.ul.y > box1.ur.y ||
(box1.ur.y == box2.ul.y || box2.ur.y == box1.ul.y) && ((box1.ur.y == box2.ul.y || box2.ur.y == box1.ul.y) &&
box1.ul.y != box1.ur.y && box2.ul.y != box2.ur.y) { box1.ul.y != box1.ur.y && box2.ul.y != box2.ur.y)) {
if (flag & 1) if (flag & 1)
SWAP(box1.ul.y, box1.ur.y); SWAP(box1.ul.y, box1.ur.y);
if (flag & 2) if (flag & 2)
@ -858,8 +858,8 @@ bool Actor::findPathTowards(byte box1nr, byte box2nr, byte box3nr, Common::Point
} }
if (box1.ul.x > box2.ur.x || box2.ul.x > box1.ur.x || if (box1.ul.x > box2.ur.x || box2.ul.x > box1.ur.x ||
(box1.ur.x == box2.ul.x || box2.ur.x == box1.ul.x) && ((box1.ur.x == box2.ul.x || box2.ur.x == box1.ul.x) &&
box1.ul.x != box1.ur.x && box2.ul.x != box2.ur.x) { box1.ul.x != box1.ur.x && box2.ul.x != box2.ur.x)) {
if (flag & 1) if (flag & 1)
SWAP(box1.ul.x, box1.ur.x); SWAP(box1.ul.x, box1.ur.x);
if (flag & 2) if (flag & 2)
@ -1074,8 +1074,8 @@ bool ScummEngine::areBoxesNeighbours(int box1nr, int box2nr) {
} }
if (box.ur.y < box2.ul.y || if (box.ur.y < box2.ul.y ||
box.ul.y > box2.ur.y || box.ul.y > box2.ur.y ||
(box.ul.y == box2.ur.y || ((box.ul.y == box2.ur.y ||
box.ur.y == box2.ul.y) && box2.ur.y != box2.ul.y && box.ul.y != box.ur.y) { box.ur.y == box2.ul.y) && box2.ur.y != box2.ul.y && box.ul.y != box.ur.y)) {
} else { } else {
return true; return true;
} }
@ -1103,8 +1103,8 @@ bool ScummEngine::areBoxesNeighbours(int box1nr, int box2nr) {
} }
if (box.ur.x < box2.ul.x || if (box.ur.x < box2.ul.x ||
box.ul.x > box2.ur.x || box.ul.x > box2.ur.x ||
(box.ul.x == box2.ur.x || ((box.ul.x == box2.ur.x ||
box.ur.x == box2.ul.x) && box2.ur.x != box2.ul.x && box.ul.x != box.ur.x) { box.ur.x == box2.ul.x) && box2.ur.x != box2.ul.x && box.ul.x != box.ur.x)) {
} else { } else {
return true; return true;

View file

@ -1402,7 +1402,7 @@ void ScummEngine_v5::o5_ifClassOfIs() {
while ((_opcode = fetchScriptByte()) != 0xFF) { while ((_opcode = fetchScriptByte()) != 0xFF) {
cls = getVarOrDirectWord(PARAM_1); cls = getVarOrDirectWord(PARAM_1);
b = getClass(act, cls); b = getClass(act, cls);
if (cls & 0x80 && !b || !(cls & 0x80) && b) if (((cls & 0x80) && !b) || (!(cls & 0x80) && b))
cond = false; cond = false;
} }
if (cond) if (cond)