X-Git-Url: http://git.pond.sub.org/?p=empserver;a=blobdiff_plain;f=src%2Flib%2Fcommands%2Fmark.c;h=fd265ea9021c095f24c84078214a8c8f9171c9dd;hp=4b52e722e60731289b6902ab707bc2a8f5156ab2;hb=375e5170e47c4e47ffab5918288aafad92844b21;hpb=c5f76e58534bd0760730863b729ce2bc3f054b76 diff --git a/src/lib/commands/mark.c b/src/lib/commands/mark.c index 4b52e722e..fd265ea90 100644 --- a/src/lib/commands/mark.c +++ b/src/lib/commands/mark.c @@ -30,6 +30,7 @@ * Dave Pare, 1986 * Pat Loney, 1992 * Steve McClure, 1996 + * Markus Armbruster, 2004-2013 */ #include @@ -70,15 +71,14 @@ mark(void) static void pr_mark(struct comstr *comm) { - time_t now; - double tleft; + time_t now, tleft; (void)time(&now); - tleft = MARK_DELAY / 3600.0 - (now - comm->com_markettime) / 3600.0; - if (tleft < 0.0) - tleft = 0.0; + tleft = comm->com_markettime + MARK_DELAY - now; + if (tleft < 0) + tleft = 0; pr(" %3d $%12.2f %2d %5.2f hrs (%3d) %c %6d ", - comm->com_uid, comm->com_price, comm->com_maxbidder, tleft, + comm->com_uid, comm->com_price, comm->com_maxbidder, tleft / 3600.0, comm->com_owner, ichr[comm->com_type].i_mnem, comm->com_amount); if (comm->com_owner == player->cnum || player->god) pr("%s", xyas(comm->sell_x, comm->sell_y, player->cnum));