Aedit "features"...part 1

From: Matthias Elsdragon (MgicTG1@aol.com)
Date: 04/28/00


I just hate when you add something new to your mud, and all of these new
"features" pop up... ;)

It seems that after adding in the 'aedit' patch (i did it manually, i
dont trust the patch program) that any of my other OLC-related things to
not work, ie zedit, medit, et cetera. I am almost 100% positive that the
"feature" happens in the do_olc function. After running this function
step-by-step, I cannot even begin to guess at what may be wrong, except
possibly a missing or misplace }, but I can't seem to find it. And this
is trying almost 18 or so hours straight. ;)

Well any help is appreciated, and thanks in advance! (And yes, I've RTFM, and
the archives ;))
-Matthias Elsdragon
(rest of code to be continued)
//BEGIN
ACMD(do_olc)
{
    int number = -1, save = 0, real_num;
    struct descriptor_data *d;
    /*
    * No screwing around as a mobile.
    */
    if (IS_NPC(ch))
        return;
    if (subcmd == SCMD_OLC_SAVEINFO) {
        olc_saveinfo(ch);
        return;
    }
    /*
    * Parse any arguments.
    */
    two_arguments(argument, buf1, buf2);
    if (!*buf1) /* No argument given. */ {
        switch (subcmd)         {
        case SCMD_OLC_ZEDIT:
        case SCMD_OLC_REDIT:
            number = world[IN_ROOM(ch)].number;
            break;
        case SCMD_OLC_OEDIT:
        case SCMD_OLC_MEDIT:
        case SCMD_OLC_SEDIT:
        case SCMD_OLC_TRIGEDIT:
            sprintf(buf, "Specify a %s VNUM to edit.\r\n",
olc_scmd_info[subcmd].text);
            send_to_char(buf, ch);
            return;
        /* -mm 42500 */
        case SCMD_OASIS_AEDIT:
            send_to_char("Specify an action to edit.\r\n", ch);
            return;
        }
    } else if (!isdigit(*buf1))     {
        if (strn_cmp("save", buf1, 4) == 0)         {
            if (!*buf2)             {
                if (GET_OLC_ZONE(ch))                 {
                    save = 1;
                    number = (GET_OLC_ZONE(ch) * 100);
                } else                 {
                    /* -mm 42500 */
                    if (subcmd != SCMD_OASIS_AEDIT) {
                        if ((number = (*buf2 ? atoi(buf2) :
(GET_OLC_ZONE(ch) ? GET_OLC_ZONE(ch) : -1)) * 100) < 0 )  {
                            send_to_char("Save which zone?\r\n", ch);
                            return;
                        }
                    } else {
                        save = 1;
                        number = atoi(buf2) * 100;
                    }
                }
            }
            else if (subcmd == SCMD_OASIS_AEDIT)
                number = 0;
            else if (subcmd == SCMD_OLC_ZEDIT && GET_LEVEL(ch) >=
LVL_IMPL)    {
                if ((strn_cmp("new", buf1, 3) == 0) && *buf2)
                    zedit_new_zone(ch, atoi(buf2));
                else
                    send_to_char("Specify a new zone number.\r\n", ch);
                return;
            } else    {
                send_to_char("Yikes!  Stop that, someone will get
hurt!\r\n", ch);
                return;
            }
        }

        /*
        * If a numeric argument was given, get it.
        */
        if (number == -1)
            number = atoi(buf1);
            /*
            * Check that whatever it is isn't already being edited.
        */
        for (d = descriptor_list; d; d = d->next)
            if (d->connected == olc_scmd_info[subcmd].con_type)
            if (d->olc && OLC_NUM(d) == number)   {
            /* -mm 42500 */
            if (subcmd == SCMD_OASIS_AEDIT)
                sprintf(buf, "Actions are already being editted by
%s.\r\n", (CAN_SEE(ch, d->character) ? GET_NAME(d->character) :
"someone"));
            else
                sprintf(buf, "That %s is currently being edited by
%s.\r\n", olc_scmd_info[subcmd].text, PERS(d->character, ch));
            send_to_char(buf, ch);
            return;
        }
        d = ch->desc;

        /*
        * Give descriptor an OLC struct.
        */
        CREATE(d->olc, struct olc_data, 1);

        /*
        * Find the zone.
        */
        if (subcmd != SCMD_OASIS_AEDIT)   {
            if ((OLC_ZNUM(d) = real_zone(number)) == -1)   {
                send_to_char("Sorry, there is no zone for that
number!\r\n", ch);
                free(d->olc);
                d->olc = NULL;
                return;
            }
        }
        else if ((!(GET_LEVEL(ch) < LVL_IMPL)) &&
(!ch->player_specials->saved.olc_zone == AEDIT_PERMISSION)) {
            send_to_char("You do not have permission to edit
actions.\r\n", ch);
            free(d->olc);
            return;
        }

        /*
        * Everyone but IMPLs can only edit zones they have been
assigned.
        */
        if ((GET_LEVEL(ch) < LVL_IMPL) &&
(zone_table[OLC_ZNUM(d)].number != GET_OLC_ZONE(ch))) {
            send_to_char("You do not have permission to edit this
zone.\r\n", ch);
            free(d->olc);
            return;
        }


     +------------------------------------------------------------+
     | 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 : 04/10/01 PDT