From ed88f3140dc1a99a1737f1003d50964a1e43c151 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sun, 13 Aug 2006 07:29:30 +0000 Subject: [PATCH] (EF_IS_VIEW): New. (xdump): Use it to deny access to views when denying access to game state. Fixes the previous revision. --- include/file.h | 1 + src/lib/commands/xdump.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/file.h b/include/file.h index 2e7c0cbb..71c5e1c1 100644 --- a/include/file.h +++ b/include/file.h @@ -158,6 +158,7 @@ enum { }; #define EF_IS_GAME_STATE(type) (EF_SECTOR <= (type) && (type) <= EF_REALM) +#define EF_IS_VIEW(type) (EF_COUNTRY <= (type) && (type) < EF_MAX) extern struct castr *ef_cadef(int); extern int ef_read(int, int, void *); diff --git a/src/lib/commands/xdump.c b/src/lib/commands/xdump.c index 9122eae6..f09fcb03 100644 --- a/src/lib/commands/xdump.c +++ b/src/lib/commands/xdump.c @@ -405,7 +405,7 @@ xdump(void) if (type >= 0 && type < EF_MAX) { if (meta) return xdmeta(type); - else if (EF_IS_GAME_STATE(type) + else if ((EF_IS_GAME_STATE(type) || EF_IS_VIEW(type)) && (player->ncomstat & NORM) != NORM) { pr("Access to table %s denied\n", ef_nameof(type)); return RET_FAIL;