]> git.pond.sub.org Git - empserver/blobdiff - src/lib/player/player.c
COPYING duplicates information from README. Remove. Move GPL from
[empserver] / src / lib / player / player.c
index 0a061276fa8d5ba5bcf3510888498901619bf4a9..a0621efb4da6d40352693e58902cfe72441a88a7 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2005, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ *  Copyright (C) 1986-2006, Dave Pare, Jeff Bailey, Thomas Ruschak,
  *                           Ken Stevens, Steve McClure
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -19,9 +19,9 @@
  *
  *  ---
  *
- *  See the "LEGAL", "LICENSE", "CREDITS" and "README" files for all the
- *  related information and legal notices. It is expected that any future
- *  projects/authors will amend these files as needed.
+ *  See files README, COPYING and CREDITS in the root of the source
+ *  tree for related information and legal notices.  It is expected
+ *  that future projects/authors will amend these files as needed.
  *
  *  ---
  *
@@ -86,7 +86,7 @@ player_main(struct player *p)
     }
     if (!gamehours(player->curup)) {
        pr("Empire hours restriction in force\n");
-       if ((natp->nat_stat & STAT_GOD) == 0)
+       if (natp->nat_stat != STAT_GOD)
            return;
     }
     daychange(player->curup);
@@ -94,7 +94,7 @@ player_main(struct player *p)
        pr("Time exceeded today\n");
        return;
     }
-    if (natp->nat_stat != VIS
+    if (natp->nat_stat != STAT_VIS
        && natp->nat_last_login
        && (strcmp(natp->nat_hostaddr, player->hostaddr)
            || strcmp(natp->nat_userid, player->userid))) {
@@ -134,7 +134,7 @@ player_main(struct player *p)
      * charging at least 15 seconds.
      */
     time(&natp->nat_last_logout);
-    secs = max(natp->nat_last_logout - player->lasttime, 15);
+    secs = MAX(natp->nat_last_logout - player->lasttime, 15);
     natp->nat_minused += secs / 60;
     secs = secs % 60;
     if (chance(secs / 60.0))
@@ -186,7 +186,7 @@ status(void)
        putnat(natp);
        return 0;
     }
-    player->visitor = (natp->nat_stat & (STAT_NORM | STAT_GOD)) == 0;
+    player->visitor = natp->nat_stat < STAT_SANCT;
     if (player->dolcost != 0.0) {
        if (player->dolcost > 100.0)
            pr("That just cost you $%.2f\n", player->dolcost);
@@ -221,6 +221,8 @@ status(void)
     else
        player->nstat |= CAP;
     player->ncomstat = player->nstat;
+    if (player->god)
+       player->ncomstat |= CAP | MONEY;
     time(&player->curup);
     minute = (player->curup - player->lasttime) / 60;
     if (minute > 0) {
@@ -233,7 +235,7 @@ status(void)
            daychange(player->curup);
            if (!gamehours(player->curup)) {
                pr("Empire hours restriction in force\n");
-               if ((natp->nat_stat & STAT_GOD) == 0) {
+               if (natp->nat_stat != STAT_GOD) {
                    putnat(natp);
                    return 0;
                }
@@ -243,8 +245,7 @@ status(void)
        player->lasttime += minute * 60;
        natp->nat_minused += minute;
     }
-    if ((player->nstat & STAT_NORM) && !player->god
-       && natp->nat_minused > m_m_p_d) {
+    if (natp->nat_stat == STAT_ACTIVE && natp->nat_minused > m_m_p_d) {
        pr("Max minutes per day limit exceeded.\n");
        player->ncomstat = VIS;
     }