(starv_sects): Reported food need was one short when the sector had no
food.
This commit is contained in:
parent
99fc82b94d
commit
a33f1378e8
1 changed files with 11 additions and 3 deletions
|
@ -108,7 +108,7 @@ starv_sects(char *range)
|
||||||
struct nstr_sect nstr;
|
struct nstr_sect nstr;
|
||||||
struct sctstr sect;
|
struct sctstr sect;
|
||||||
int nsect = 0;
|
int nsect = 0;
|
||||||
int s;
|
int s, save;
|
||||||
|
|
||||||
if (!snxtsct(&nstr, range))
|
if (!snxtsct(&nstr, range))
|
||||||
return;
|
return;
|
||||||
|
@ -118,12 +118,20 @@ starv_sects(char *range)
|
||||||
if (sect.sct_type == SCT_SANCT)
|
if (sect.sct_type == SCT_SANCT)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Check for starvation. Suppress complaints about tiny
|
||||||
|
* population without food by adding 1f just for the check.
|
||||||
|
* That's okay because growfood() will grow at least that much
|
||||||
|
* anyway.
|
||||||
|
*/
|
||||||
|
save = sect.sct_item[I_FOOD];
|
||||||
if (sect.sct_item[I_FOOD] == 0)
|
if (sect.sct_item[I_FOOD] == 0)
|
||||||
sect.sct_item[I_FOOD] = 1; /* see growfood() */
|
sect.sct_item[I_FOOD] = 1;
|
||||||
s = famine_victims(sect.sct_item, etu_per_update);
|
s = famine_victims(sect.sct_item, etu_per_update);
|
||||||
|
sect.sct_item[I_FOOD] = save;
|
||||||
if (s == 0)
|
if (s == 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (nsect++ == 0)
|
if (nsect++ == 0)
|
||||||
sect_hdr();
|
sect_hdr();
|
||||||
if (player->god)
|
if (player->god)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue