[Code] Arguments in Wait State

From: Aaron Miller (Tarus50@CONCENTRIC.NET)
Date: 10/01/97


Thanks to everyone who helped me out on the last thing. It was a very
stupid error of mine that was causing it not to work :( Fixed now, tho

Now, I added a new "wait state" to interpreter.c, and I have it working
great. Now, heres my question. How can I get the arguments from *arg?
Heres what I am doing with the wait state..

   case CON_CHARGEN: /* defined in structs.h */
    if (!strcmp(arg, "stats"))
      gen_cmd = 0;
    if (!strcmp(arg, "done"))
      gen_cmd = 1;

    /* And so on */

    switch(gen_cmd) {
     case 0:
      bla
     case 1:
      bla
     default:
      bla
     }

Now, lets say I have a case in there that is run when the user types in
str. I want to check to see what arguments they passed along. Also, one
other thing. I have a case like this in the afor mentioned switch.

    case 5:
     str++;
     sprintf("Strength is now %d.", str_att);
     SEND_TO_Q(buf, d);
     return;

This will work, but when I check str_att later (in the same wait state,
btw) it will be at its original value. I tried return str_att; but the
compiler didn't like that. Thanks everyone.


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



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