Drop resnoise()'s second parameter
All callers pass the same argument.
This commit is contained in:
parent
eb4adc93ff
commit
efa4ecdc4d
3 changed files with 15 additions and 31 deletions
|
@ -63,7 +63,7 @@ extern int nav_map(int, int, int);
|
||||||
extern int do_unit_move(struct emp_qelem *, int *, double *, double *);
|
extern int do_unit_move(struct emp_qelem *, int *, double *, double *);
|
||||||
extern int count_pop(int);
|
extern int count_pop(int);
|
||||||
extern int scuttle_tradeship(struct shpstr *, int);
|
extern int scuttle_tradeship(struct shpstr *, int);
|
||||||
extern void resnoise(struct sctstr *, int, char *, int, int);
|
extern void resnoise(struct sctstr *, char *, int, int);
|
||||||
extern int line_of_sight(char **rad, int ax, int ay, int bx, int by);
|
extern int line_of_sight(char **rad, int ax, int ay, int bx, int by);
|
||||||
extern void plane_sona(struct emp_qelem *, int, int, struct shiplist **);
|
extern void plane_sona(struct emp_qelem *, int, int, struct shiplist **);
|
||||||
extern char *prsub(struct shpstr *);
|
extern char *prsub(struct shpstr *);
|
||||||
|
|
|
@ -72,31 +72,27 @@ setres(void)
|
||||||
switch (char0) {
|
switch (char0) {
|
||||||
case 'i':
|
case 'i':
|
||||||
if (sect.sct_own != 0)
|
if (sect.sct_own != 0)
|
||||||
resnoise(§, 1, "Iron ore content",
|
resnoise(§, "Iron ore content", sect.sct_min, amt);
|
||||||
(int)sect.sct_min, amt);
|
|
||||||
sect.sct_min = (unsigned char)amt;
|
sect.sct_min = (unsigned char)amt;
|
||||||
break;
|
break;
|
||||||
case 'g':
|
case 'g':
|
||||||
if (sect.sct_own != 0)
|
if (sect.sct_own != 0)
|
||||||
resnoise(§, 1, "Gold content",
|
resnoise(§, "Gold content", sect.sct_gmin, amt);
|
||||||
(int)sect.sct_gmin, amt);
|
|
||||||
sect.sct_gmin = (unsigned char)amt;
|
sect.sct_gmin = (unsigned char)amt;
|
||||||
break;
|
break;
|
||||||
case 'o':
|
case 'o':
|
||||||
if (sect.sct_own != 0)
|
if (sect.sct_own != 0)
|
||||||
resnoise(§, 1, "Oil content", (int)sect.sct_oil, amt);
|
resnoise(§, "Oil content", sect.sct_oil, amt);
|
||||||
sect.sct_oil = (unsigned char)amt;
|
sect.sct_oil = (unsigned char)amt;
|
||||||
break;
|
break;
|
||||||
case 'f':
|
case 'f':
|
||||||
if (sect.sct_own != 0)
|
if (sect.sct_own != 0)
|
||||||
resnoise(§, 1, "Fertility content",
|
resnoise(§, "Fertility content", sect.sct_fertil, amt);
|
||||||
(int)sect.sct_fertil, amt);
|
|
||||||
sect.sct_fertil = (unsigned char)amt;
|
sect.sct_fertil = (unsigned char)amt;
|
||||||
break;
|
break;
|
||||||
case 'u':
|
case 'u':
|
||||||
if (sect.sct_own != 0)
|
if (sect.sct_own != 0)
|
||||||
resnoise(§, 1, "Uranium content",
|
resnoise(§, "Uranium content", sect.sct_uran, amt);
|
||||||
(int)sect.sct_uran, amt);
|
|
||||||
sect.sct_uran = (unsigned char)amt;
|
sect.sct_uran = (unsigned char)amt;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -77,8 +77,7 @@ setsector(void)
|
||||||
if (current > 100)
|
if (current > 100)
|
||||||
current = 100;
|
current = 100;
|
||||||
if (sect.sct_own != 0)
|
if (sect.sct_own != 0)
|
||||||
resnoise(§, 1, "Iron ore content",
|
resnoise(§, "Iron ore content", sect.sct_min, current);
|
||||||
(int)sect.sct_min, current);
|
|
||||||
sect.sct_min = (unsigned char)current;
|
sect.sct_min = (unsigned char)current;
|
||||||
break;
|
break;
|
||||||
case 'g':
|
case 'g':
|
||||||
|
@ -89,8 +88,7 @@ setsector(void)
|
||||||
if (current > 100)
|
if (current > 100)
|
||||||
current = 100;
|
current = 100;
|
||||||
if (sect.sct_own != 0)
|
if (sect.sct_own != 0)
|
||||||
resnoise(§, 1, "Gold content",
|
resnoise(§, "Gold content", sect.sct_gmin, current);
|
||||||
(int)sect.sct_gmin, current);
|
|
||||||
sect.sct_gmin = (unsigned char)current;
|
sect.sct_gmin = (unsigned char)current;
|
||||||
break;
|
break;
|
||||||
case 'o':
|
case 'o':
|
||||||
|
@ -103,8 +101,7 @@ setsector(void)
|
||||||
if (current > 100)
|
if (current > 100)
|
||||||
current = 100;
|
current = 100;
|
||||||
if (sect.sct_own != 0)
|
if (sect.sct_own != 0)
|
||||||
resnoise(§, 1, "Oil content",
|
resnoise(§, "Oil content", sect.sct_oil, current);
|
||||||
(int)sect.sct_oil, current);
|
|
||||||
sect.sct_oil = (unsigned char)current;
|
sect.sct_oil = (unsigned char)current;
|
||||||
break;
|
break;
|
||||||
case 'w':
|
case 'w':
|
||||||
|
@ -159,7 +156,7 @@ setsector(void)
|
||||||
if (current > MINES_MAX)
|
if (current > MINES_MAX)
|
||||||
current = MINES_MAX;
|
current = MINES_MAX;
|
||||||
if (sect.sct_own != 0 && sect.sct_own == sect.sct_oldown)
|
if (sect.sct_own != 0 && sect.sct_own == sect.sct_oldown)
|
||||||
resnoise(§, 1, "Mines", sect.sct_mines, current);
|
resnoise(§, "Mines", sect.sct_mines, current);
|
||||||
sect.sct_mines = current;
|
sect.sct_mines = current;
|
||||||
break;
|
break;
|
||||||
case 'o':
|
case 'o':
|
||||||
|
@ -208,8 +205,7 @@ setsector(void)
|
||||||
if (current > 100)
|
if (current > 100)
|
||||||
current = 100;
|
current = 100;
|
||||||
if (sect.sct_own != 0)
|
if (sect.sct_own != 0)
|
||||||
resnoise(§, 1, "Fertility content",
|
resnoise(§, "Fertility content", sect.sct_fertil, current);
|
||||||
(int)sect.sct_fertil, current);
|
|
||||||
sect.sct_fertil = (unsigned char)current;
|
sect.sct_fertil = (unsigned char)current;
|
||||||
break;
|
break;
|
||||||
case 'u':
|
case 'u':
|
||||||
|
@ -220,8 +216,7 @@ setsector(void)
|
||||||
if (current > 100)
|
if (current > 100)
|
||||||
current = 100;
|
current = 100;
|
||||||
if (sect.sct_own != 0)
|
if (sect.sct_own != 0)
|
||||||
resnoise(§, 1, "Uranium content",
|
resnoise(§, "Uranium content", sect.sct_uran, current);
|
||||||
(int)sect.sct_uran, current);
|
|
||||||
sect.sct_uran = (unsigned char)current;
|
sect.sct_uran = (unsigned char)current;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -249,21 +244,14 @@ resbenefit(natid who, int good)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
resnoise(struct sctstr *sptr, int public_amt, char *name, int old,
|
resnoise(struct sctstr *sptr, char *name, int old, int new)
|
||||||
int new)
|
|
||||||
{
|
{
|
||||||
char p[100];
|
|
||||||
|
|
||||||
pr("%s of %s changed from %d to %d\n",
|
pr("%s of %s changed from %d to %d\n",
|
||||||
name, xyas(sptr->sct_x, sptr->sct_y, player->cnum), old, new);
|
name, xyas(sptr->sct_x, sptr->sct_y, player->cnum), old, new);
|
||||||
if (public_amt)
|
|
||||||
(void)sprintf(p, "changed from %d to %d", old, new);
|
|
||||||
else
|
|
||||||
(void)sprintf(p, "%s", old < new ? "increased" : "decreased");
|
|
||||||
if (sptr->sct_own)
|
if (sptr->sct_own)
|
||||||
wu(0, sptr->sct_own,
|
wu(0, sptr->sct_own,
|
||||||
"%s in %s was %s by an act of %s\n",
|
"%s in %s was changed from %d to %d by an act of %s\n",
|
||||||
name, xyas(sptr->sct_x, sptr->sct_y, sptr->sct_own),
|
name, xyas(sptr->sct_x, sptr->sct_y, sptr->sct_own),
|
||||||
p, cname(player->cnum));
|
old, new, cname(player->cnum));
|
||||||
resbenefit(sptr->sct_own, (old < new));
|
resbenefit(sptr->sct_own, (old < new));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue