(dodeliver): Remove parameter vec, work with sp->sct_item[] instead.
This is safe, because the only caller passed a copy of the latter created with getvec(), and dodeliver() doesn't change it. Caller changed. Return value no longer needed, remove.
This commit is contained in:
parent
a46cee180a
commit
d68a0b96c6
3 changed files with 7 additions and 17 deletions
|
@ -55,34 +55,30 @@
|
|||
#include "lost.h"
|
||||
#include "gen.h"
|
||||
|
||||
int
|
||||
dodeliver(struct sctstr *sp, int *vec)
|
||||
void
|
||||
dodeliver(struct sctstr *sp)
|
||||
{
|
||||
register int i;
|
||||
int thresh;
|
||||
int dir;
|
||||
int plague;
|
||||
int n;
|
||||
int changed;
|
||||
|
||||
if (sp->sct_mobil <= 0)
|
||||
return 0;
|
||||
changed = 0;
|
||||
return;
|
||||
plague = sp->sct_pstage;
|
||||
for (i = 1; i <= I_MAX; i++) {
|
||||
if (sp->sct_del[i] == 0)
|
||||
continue;
|
||||
thresh = sp->sct_del[i] & ~0x7;
|
||||
dir = sp->sct_del[i] & 0x7;
|
||||
n = deliver(sp, &ichr[i], dir, thresh, vec[i], plague);
|
||||
n = deliver(sp, &ichr[i], dir, thresh, sp->sct_item[i], plague);
|
||||
if (n > 0) {
|
||||
vec[i] -= n;
|
||||
changed++;
|
||||
sp->sct_item[i] -= n;
|
||||
if (sp->sct_mobil <= 0)
|
||||
break;
|
||||
}
|
||||
}
|
||||
return changed;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue