named-fruit manipulation
Add some new routines for dealing with fruit. I had hoped they would let the existing fruit handling be simplified quite a bit, but the improvement wasn't great. However, they're also groundwork for fixing an old bug.
This commit is contained in:
11
src/cmd.c
11
src/cmd.c
@@ -2471,14 +2471,15 @@ int final;
|
||||
/* named fruit debugging (doesn't really belong here...); to enable,
|
||||
include 'fruit' in DEBUGFILES list (even though it isn't a file...) */
|
||||
if (wizard && explicitdebug("fruit")) {
|
||||
int fcount = 0;
|
||||
struct fruit *f;
|
||||
char buf2[BUFSZ];
|
||||
|
||||
reorder_fruit(TRUE); /* sort by fruit index, from low to high;
|
||||
* this modifies the ffruit chain, so could
|
||||
* possibly mask or even introduce a problem,
|
||||
* but it does useful sanity checking */
|
||||
for (f = ffruit; f; f = f->nextf) {
|
||||
Sprintf(buf, "Fruit %d ", ++fcount);
|
||||
Sprintf(buf2, "%s (id %d)", f->fname, f->fid);
|
||||
enl_msg(buf, "is ", "was ", buf2, "");
|
||||
Sprintf(buf, "Fruit #%d ", f->fid);
|
||||
enl_msg(buf, "is ", "was ", f->fname, "");
|
||||
}
|
||||
enl_msg("The current fruit ", "is ", "was ", pl_fruit, "");
|
||||
Sprintf(buf, "%d", flags.made_fruit);
|
||||
|
||||
Reference in New Issue
Block a user