chiark / gitweb /
commodity check works
authorIan Jackson <ian@liberator.relativity.greenend.org.uk>
Sun, 7 Jun 2009 23:04:29 +0000 (00:04 +0100)
committerIan Jackson <ian@liberator.relativity.greenend.org.uk>
Sun, 7 Jun 2009 23:04:29 +0000 (00:04 +0100)
pctb/structure.c

index 63cd641..bce649e 100644 (file)
@@ -304,17 +304,10 @@ void check_correct_commodities(void) {
        for (y=0; y<allh; y++) {
          int want= all[y][x];
          if (want==' ') continue;
-#define PIXCHECK(dx,dy) \
-          if (get(alloffx+x+dx, alloffy+y+dy) == want) goto pix_found
-         PIXCHECK( 0, 0);
-         PIXCHECK(-1,-1);
-         PIXCHECK(-1,+1);
-         PIXCHECK(+1,-1);
-         PIXCHECK(+1,+1);
-         bad++;
-         continue;
-       pix_found:
-         good++;
+          if (get(alloffx+x, alloffy+y) == want)
+           good++;
+         else
+           bad++;
        }
       debugf("CHECKCOMMOD alloff=%d,%d good=%d bad=%d\n",
             alloffx,alloffy, good,bad);