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:
PatR
2017-07-03 18:57:50 -07:00
parent fa2fbb64c8
commit ca84c8e0ff
5 changed files with 187 additions and 65 deletions

View File

@@ -45,14 +45,10 @@ STATIC_OVL void
goodfruit(id)
int id;
{
register struct fruit *f;
struct fruit *f = fruit_from_indx(-id);
for (f = ffruit; f; f = f->nextf) {
if (f->fid == -id) {
f->fid = id;
return;
}
}
if (f)
f->fid = id;
}
STATIC_OVL void