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

@ -818,17 +818,17 @@ index 513382b..4b97be7 100644
- time(&natp->nat_last_logout);
+ empire_time(&natp->nat_last_logout);
secs = MAX(natp->nat_last_logout - player->lasttime, 15);
natp->nat_minused += secs / 60;
secs = secs % 60;
natp->nat_timeused += secs;
putnat(natp);
@@ -182,7 +183,7 @@ status(void)
if (!(old_nstat & MONEY) && (player->nstat & MONEY))
pr("You are no longer broke!\n");
- time(&player->curup);
+ empire_time(&player->curup);
minute = (player->curup - player->lasttime) / 60;
if (minute > 0) {
player->minleft -= minute;
second = player->curup - player->lasttime;
if (second > 0) {
player->timeleft -= second;
diff --git a/src/lib/player/recvclient.c b/src/lib/player/recvclient.c
index ab4ef69..8934189 100644
--- a/src/lib/player/recvclient.c