chiark
/
gitweb
/
~yarrgweb
/
ypp-sc-tools.db-test.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
commodity check works
[ypp-sc-tools.db-test.git]
/
pctb
/
structure.c
diff --git
a/pctb/structure.c
b/pctb/structure.c
index 63cd641e82ebb843977bf0797ab5f589cf685d62..bce649ef101eb5bee895da9e0b39bbeae4f68576 100644
(file)
--- a/
pctb/structure.c
+++ b/
pctb/structure.c
@@
-304,17
+304,10
@@
void check_correct_commodities(void) {
for (y=0; y<allh; y++) {
int want= all[y][x];
if (want==' ') continue;
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);
}
debugf("CHECKCOMMOD alloff=%d,%d good=%d bad=%d\n",
alloffx,alloffy, good,bad);