do_set

From: Phillip Ames (grathol@hotpop.com)
Date: 09/09/01


Hi folks,
It's been a long time since I've been on the list (to the tune of a year or
two).  Anyway, I was poking through act.wizard.c and I have to admit that I
am really baffled by something.  In do_set, the type for the min level to
set is a "const char".  Further investigation of this matter prompted me to
hunt down the char_player_data struct and, lo and behold, I find the players
level stored as a 'byte'.  Now, my question is, why? :)  Why not use an
integer for the characters level, and an int for the set_struct?  If anyone
could explain to me why this is, I'd be most appreciative.  Thanks,

-Phil

--- code snips ---

/* The set options available */
  struct set_struct {
    const char *cmd;
    const char level;
    const char pcnpc;
    const char type;
  } set_fields[] = {
   { "brief",           LVL_GOD,        PC,     BINARY },  /* 0 */
 ....


/* general player-related info, usually PC's and NPC's */
struct char_player_data {
   char passwd[MAX_PWD_LENGTH+1]; /* character's password      */
....
   byte  race;          /* PC / NPC's race                      */
   byte  level;         /* PC / NPC's level                     */

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/06/01 PST