CHECK_FLAGS problems....

From: Corey Elliott (strmchsr@arn.net)
Date: 04/08/99


Ok, here goes. I have implemented a Flag system on my mud where every
character has an array
saved called quest_flags.  As things happen, Flags are altered and/or
checked to see if they
have done certain things. I need a command to set specific Flags in the
array. I'm so stupid
when it comes to structures that I can't figure out my code for this. I do
have
three_arguments coded and it is working correctly. What I want to do is be
able to type this ->

flags <player_name> <flag number> <value>

and have it set the appropriate value for the sed flag and the sed player.

** in structs.h **
    struct player_special_data_saved {
        int quest_flags[100];

** in utils.h **
    #define CHECK_FLAGS(ch, i)  CHECK_PLAYER_SPECIAL((ch),
((ch)->player_specials-
                >saved.quest_flags[(i)]))

** and the main beef **
ACMD(do_flags)
{
  struct char_data *vict = NULL;
  int number, number2, number3;
  three_arguments(argument, buf, buf2, buf3);

 if (!*buf || !*buf2 || !buf3 || !isdigit(*buf2) || !isdigit(*buf3)) {
    send_to_char("Usage: flags <victim> <flag number> <flag value>\r\n",
ch);
    return;
  }

  if ((number = atoi(buf)< 0) || (number2 = atoi(buf2) < 0) || (number3 =
atoi(buf3) < 0))
  {
    send_to_char("You can't use a negative number!\r\n", ch);
    return;
  }
    if (!(vict = get_player_vis(ch, buf, 0))) {
 send_to_char("There is no such player.\r\n", ch);
 return;
      }

    CHECK_FLAGS(buf, buf2) = buf3;
    sprintf(buf,"%s's Quest Flag %d is set at %d.\r\n",buf, buf2, buf3);
    send_to_char(buf, ch);
}

I get an error on the call to CHECK_FLAGS, and as I said before, I am still
learning with
the whole structures thing. The (I think) obvious problem is with buf not
jiving with the
char_data structure .Can someone help me out here?

Corey Elliott
strmchsr@arn.net


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST