(xdump): Fix test whether to deny access to game state. Rev. 1.72
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.
This commit is contained in:
parent
707e4fda95
commit
96b20c90b2
1 changed files with 4 additions and 2 deletions
|
@ -25,7 +25,7 @@
|
||||||
*
|
*
|
||||||
* ---
|
* ---
|
||||||
*
|
*
|
||||||
* xdump.c: Experimental extended dump
|
* xdump.c: Extended dump
|
||||||
*
|
*
|
||||||
* Known contributors to this file:
|
* Known contributors to this file:
|
||||||
* Markus Armbruster, 2004-2007
|
* Markus Armbruster, 2004-2007
|
||||||
|
@ -393,6 +393,7 @@ xdump(void)
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
int type;
|
int type;
|
||||||
int meta = 0;
|
int meta = 0;
|
||||||
|
struct natstr *natp;
|
||||||
|
|
||||||
p = getstarg(player->argp[1], "Table name, or meta? ", buf);
|
p = getstarg(player->argp[1], "Table name, or meta? ", buf);
|
||||||
if (p && strcmp(p, "meta") == 0) {
|
if (p && strcmp(p, "meta") == 0) {
|
||||||
|
@ -402,12 +403,13 @@ xdump(void)
|
||||||
if (!p || !*p)
|
if (!p || !*p)
|
||||||
return RET_SYN;
|
return RET_SYN;
|
||||||
|
|
||||||
|
natp = getnatp(player->cnum);
|
||||||
type = isdigit(p[0]) ? atoi(p) : ef_byname(p);
|
type = isdigit(p[0]) ? atoi(p) : ef_byname(p);
|
||||||
if (type >= 0 && type < EF_MAX) {
|
if (type >= 0 && type < EF_MAX) {
|
||||||
if (meta)
|
if (meta)
|
||||||
return xdmeta(type);
|
return xdmeta(type);
|
||||||
else if ((EF_IS_GAME_STATE(type) || EF_IS_VIEW(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));
|
pr("Access to table %s denied\n", ef_nameof(type));
|
||||||
return RET_FAIL;
|
return RET_FAIL;
|
||||||
} else
|
} else
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue