Represent logged in time in seconds rather than minutes

This simplifies things.  In particular, it gets rid of random rounding
in getcommand(), which created a variation in the nightly build
depending on whether the update starts before or after the deity logs
out.

Replace struct natstr member nat_minused by nat_timeused, and update
cou_ca[] accordingly (this affects xdump nat).  Replace player member
minleft by timeleft, and getminleft() by gettimeleft().  Update
getcommand(), daychange(), player_main(), status() accordingly, taking
care not to change player output.  Change edit country key 'u' to work
in seconds.
This commit is contained in:
Ron Koenderink 2008-10-28 08:48:25 -06:00
parent 436328f641
commit 14319b89ec
10 changed files with 40 additions and 42 deletions

View file

@ -300,7 +300,7 @@ prnat(struct natstr *np)
pr("Origin <o>: %3s\n",
xyas(np->nat_xorg, np->nat_yorg, player->cnum));
pr("Status <s>: 0x%x\t\t\t", np->nat_stat);
pr("Min Used <u>: %3d\n", np->nat_minused);
pr("Seconds Used <u>: %3d\n", np->nat_timeused);
pr("Technology <T>: %.2f\t\t", np->nat_level[NAT_TLEV]);
pr("Research <R>: %.2f\n", np->nat_level[NAT_RLEV]);
pr("Education <E>: %.2f\t\t", np->nat_level[NAT_ELEV]);
@ -703,10 +703,10 @@ docountry(char op, int arg, char *p, struct natstr *np)
np->nat_stat = errcheck(arg, STAT_UNUSED, STAT_GOD);
break;
case 'u':
arg = errcheck(arg, 0, m_m_p_d);
pr("Number of minutes used changed from %d to %d.\n",
np->nat_minused, arg);
np->nat_minused = arg;
arg = errcheck(arg, 0, m_m_p_d * 60);
pr("Number of seconds used changed from %d to %d.\n",
np->nat_timeused, arg);
np->nat_timeused = arg;
break;
case 'M':
pr("Money changed from %ld to %d\n", np->nat_money, arg);