(EF_IS_VIEW): New.

(xdump): Use it to deny access to views when denying access to game
state.  Fixes the previous revision.
This commit is contained in:
Markus Armbruster 2006-08-13 07:29:30 +00:00
parent 7e474afa32
commit ed88f3140d
2 changed files with 2 additions and 1 deletions

View file

@ -158,6 +158,7 @@ enum {
}; };
#define EF_IS_GAME_STATE(type) (EF_SECTOR <= (type) && (type) <= EF_REALM) #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 struct castr *ef_cadef(int);
extern int ef_read(int, int, void *); extern int ef_read(int, int, void *);

View file

@ -405,7 +405,7 @@ xdump(void)
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) else if ((EF_IS_GAME_STATE(type) || EF_IS_VIEW(type))
&& (player->ncomstat & NORM) != NORM) { && (player->ncomstat & NORM) != NORM) {
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;