(dodeliver): Move from sect.c to deliver.c. No functional changes.
(deliver): Static linkage.
This commit is contained in:
parent
5ca57434dd
commit
92799db17b
3 changed files with 28 additions and 30 deletions
|
@ -540,8 +540,7 @@ extern void delete_old_announcements(void);
|
||||||
/* bp.c */
|
/* bp.c */
|
||||||
/* in budg.h */
|
/* in budg.h */
|
||||||
/* deliver.c */
|
/* deliver.c */
|
||||||
extern int deliver(register struct sctstr *, struct ichrstr *, int, int,
|
extern void dodeliver(struct sctstr *);
|
||||||
int, int);
|
|
||||||
/* distribute.c */
|
/* distribute.c */
|
||||||
extern int dodistribute(struct sctstr *, int, s_char *, double, double);
|
extern int dodistribute(struct sctstr *, int, s_char *, double, double);
|
||||||
/* finish.c */
|
/* finish.c */
|
||||||
|
@ -613,7 +612,6 @@ extern void guerrilla(struct sctstr *);
|
||||||
/* sail.c */
|
/* sail.c */
|
||||||
extern void sail_ship(natid);
|
extern void sail_ship(natid);
|
||||||
/* sect.c */
|
/* sect.c */
|
||||||
extern void dodeliver(struct sctstr *);
|
|
||||||
extern void do_fallout(register struct sctstr *, register int);
|
extern void do_fallout(register struct sctstr *, register int);
|
||||||
extern void spread_fallout(struct sctstr *, int);
|
extern void spread_fallout(struct sctstr *, int);
|
||||||
extern void decay_fallout(struct sctstr *, int);
|
extern void decay_fallout(struct sctstr *, int);
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
#include "subs.h"
|
#include "subs.h"
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
||||||
int
|
static int
|
||||||
deliver(register struct sctstr *from, struct ichrstr *ip, int dir,
|
deliver(register struct sctstr *from, struct ichrstr *ip, int dir,
|
||||||
int thresh, int amt_src, int plague)
|
int thresh, int amt_src, int plague)
|
||||||
{
|
{
|
||||||
|
@ -115,3 +115,29 @@ deliver(register struct sctstr *from, struct ichrstr *ip, int dir,
|
||||||
from->sct_mobil = n;
|
from->sct_mobil = n;
|
||||||
return amt_moved;
|
return amt_moved;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
dodeliver(struct sctstr *sp)
|
||||||
|
{
|
||||||
|
register int i;
|
||||||
|
int thresh;
|
||||||
|
int dir;
|
||||||
|
int plague;
|
||||||
|
int n;
|
||||||
|
|
||||||
|
if (sp->sct_mobil <= 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, sp->sct_item[i], plague);
|
||||||
|
if (n > 0) {
|
||||||
|
sp->sct_item[i] -= n;
|
||||||
|
if (sp->sct_mobil <= 0)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -55,32 +55,6 @@
|
||||||
#include "lost.h"
|
#include "lost.h"
|
||||||
#include "gen.h"
|
#include "gen.h"
|
||||||
|
|
||||||
void
|
|
||||||
dodeliver(struct sctstr *sp)
|
|
||||||
{
|
|
||||||
register int i;
|
|
||||||
int thresh;
|
|
||||||
int dir;
|
|
||||||
int plague;
|
|
||||||
int n;
|
|
||||||
|
|
||||||
if (sp->sct_mobil <= 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, sp->sct_item[i], plague);
|
|
||||||
if (n > 0) {
|
|
||||||
sp->sct_item[i] -= n;
|
|
||||||
if (sp->sct_mobil <= 0)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Increase sector efficiency if old type == new type.
|
* Increase sector efficiency if old type == new type.
|
||||||
* decrease sector efficiency if old type != new type.
|
* decrease sector efficiency if old type != new type.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue