]> git.pond.sub.org Git - empserver/commitdiff
(xdump): Fix test whether to deny access to game state. Rev. 1.72
authorMarkus Armbruster <armbru@pond.sub.org>
Sat, 8 Dec 2007 18:05:51 +0000 (18:05 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Sat, 8 Dec 2007 18:05:51 +0000 (18:05 +0000)
added that test to make xdump available before break, and faithfully
denied access exactly when xdump wasn't available before.  This denied
access when maximum minutes per day were exceeded.  Don't.

src/lib/commands/xdump.c

index 77b3eed3d5f4725ecef2037997e2f42b84d0f8df..c552250d7c733152714dcd774546dad75d79e88c 100644 (file)
@@ -25,7 +25,7 @@
  *
  *  ---
  *
- *  xdump.c: Experimental extended dump
+ *  xdump.c: Extended dump
  * 
  *  Known contributors to this file:
  *     Markus Armbruster, 2004-2007
@@ -393,6 +393,7 @@ xdump(void)
     char buf[1024];
     int type;
     int meta = 0;
+    struct natstr *natp;
 
     p = getstarg(player->argp[1], "Table name, or meta? ", buf);
     if (p && strcmp(p, "meta") == 0) {
@@ -402,12 +403,13 @@ xdump(void)
     if (!p || !*p)
        return RET_SYN;
 
+    natp = getnatp(player->cnum);
     type = isdigit(p[0]) ? atoi(p) : ef_byname(p);
     if (type >= 0 && type < EF_MAX) {
        if (meta)
            return xdmeta(type);
        else if ((EF_IS_GAME_STATE(type) || EF_IS_VIEW(type))
-                && (player->ncomstat & NORM) != NORM) {
+                && !(natp->nat_stat == STAT_ACTIVE || player->god)) {
            pr("Access to table %s denied\n", ef_nameof(type));
            return RET_FAIL;
        } else