(hap_req): New.
(nati, populace): Use it. (populace, nati): Change hap, pct from float to double, because they are used as double. (nati): Print happiness needed with just two decimals, like the other levels.
This commit is contained in:
parent
222847bb75
commit
97be5018e2
4 changed files with 15 additions and 13 deletions
|
@ -47,7 +47,7 @@ nati(void)
|
|||
{
|
||||
struct natstr *natp;
|
||||
struct sctstr sect;
|
||||
float hap;
|
||||
double hap;
|
||||
int mil;
|
||||
int civ;
|
||||
int cnum;
|
||||
|
@ -122,11 +122,9 @@ nati(void)
|
|||
|
||||
pr("Max safe population for civs/uws: %d/%d\n", safepop, uwpop);
|
||||
|
||||
hap = ((natp->nat_level[NAT_TLEV] - 40) / 40.0 +
|
||||
natp->nat_level[NAT_ELEV] / 3.0);
|
||||
|
||||
hap = hap_req(natp);
|
||||
if (hap > 0.0)
|
||||
pr("Happiness needed is %f\n", hap);
|
||||
pr("Happiness needed is %.2f\n", hap);
|
||||
else
|
||||
pr("No happiness needed\n");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue