]> git.pond.sub.org Git - empserver/commitdiff
Clean up c_permit values of deity commands
authorMarkus Armbruster <armbru@pond.sub.org>
Sat, 18 Feb 2012 14:00:57 +0000 (15:00 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Sat, 25 Feb 2012 10:22:36 +0000 (11:22 +0100)
A player may execute a command when his player->nstat has all the bits
in the command's c_permit.

Normal player commands require bit(2).  Command break requires bit(1),
and execute requires bit(5).  Deity commands require both bit(2) and
bit(3).  Works, because deities always have both bits set in nstat, as
they may execute normal player commands, too.  But it's a bit
confusing.  Change them to only require their own bit(3).

include/com.h
include/player.h
src/lib/player/init_nats.c

index 39ff1d9ad88e9a74f14fcca173b13b5918b8023e..ed3460566fe9eae4d0abb0888fc21e13989ff980 100644 (file)
@@ -38,7 +38,7 @@ struct cmndstr {
     int c_cost;                        /* btu cost of command */
     int (*c_addr)(void);       /* core addr of appropriate routine */
     int c_flags;               /* command flags */
     int c_cost;                        /* btu cost of command */
     int (*c_addr)(void);       /* core addr of appropriate routine */
     int c_flags;               /* command flags */
-    int c_permit;              /* who is allowed to "do" this command */
+    int c_permit;              /* command capabilities required */
 };
 
 /* Command flag bits */
 };
 
 /* Command flag bits */
index 8c9691be9464663a533cb51aab528cdb43e8caa7..db1034cb6f36fa1747e2ea15a04e3f0c3af79a99 100644 (file)
 #include "queue.h"
 #include "types.h"
 
 #include "queue.h"
 #include "types.h"
 
-       /* nstat values */
-#define SANCT          bit(1)
-#define NORM           bit(2)
-#define GOD            (bit(3) | NORM)
-#define EXEC           bit(5)
-#define CAP            bit(6)
-#define MONEY          bit(7)
+       /* player command capabilities */
+#define SANCT  bit(1)  /* can execute commands available in sanctuary */
+#define NORM   bit(2)  /* can execute active player commands */
+#define GOD    bit(3)  /* can execute deity commands */
+#define EXEC   bit(5)  /* can execute the execute command */
+#define CAP    bit(6)  /* has capital */
+#define MONEY  bit(7)  /* isn't broke */
 
 enum player_sleep {
     PLAYER_SLEEP_NEVER, PLAYER_SLEEP_ON_INPUT, PLAYER_SLEEP_FREELY
 
 enum player_sleep {
     PLAYER_SLEEP_NEVER, PLAYER_SLEEP_ON_INPUT, PLAYER_SLEEP_FREELY
index 5f83c15c8a41119f7f699efad6acb8a342627230..f2880209dffb04e2ed29b890deea5c9ac6f2c1fe 100644 (file)
@@ -70,7 +70,7 @@ player_set_nstat(struct player *pl, struct natstr *np)
 {
     static int nstat[] = {
        /* must match nat_status */
 {
     static int nstat[] = {
        /* must match nat_status */
-       0, 0, 0, SANCT, NORM, GOD | CAP | MONEY
+       0, 0, 0, SANCT, NORM, GOD | NORM | CAP | MONEY
     };
 
     if (CANT_HAPPEN(pl->cnum != np->nat_cnum))
     };
 
     if (CANT_HAPPEN(pl->cnum != np->nat_cnum))