Yes yes...I am just catching up on a few days inactivity...best to
squish this so no one else askes about it...at least for another week...

The problem lies in how the comamnds are displayed. In the aedit_table,
"commands" uses the function show_commands() which is nothing more than
a redirect to show_olc_cmds(). Now, the first thing this does, is table
= get_olc_tabla( ch->desc->editor ); Unfortunately, aedit wasn't moved
over to the 2.0 system for some reason...and thus, isn't listing in
get_olc_tabla.

Now, there are really 3 ways to fix this (short of a horrible hack).
One, is Michael's suggestion: make a duplicate aedit table (and dup
tables for any other oldstyle editor you have). Second, update all your
old editors to the new style. Or third, you can do what I did:

In show_olc_cmds() replace the table == NULL check with this:

        if (table == NULL)
        {
                table2 = get_olc_table2(ch->desc->editor);

                if (table2 == NULL)
                {
                        bugf( "slow_olc_cmds : table NULL, editor %d",
                                ch->desc->editor );
                        return;
                }

                for (cmd = 0; table2[cmd].name != NULL; cmd++)
                {
                        sprintf (buf, "%-15.15s", table2[cmd].name);
                        strcat (buf1, buf);
                        if (++col % 5 == 0)
                                strcat (buf1, "\n\r");
                }

                if (col % 5 != 0)
                        strcat (buf1, "\n\r");

                send_to_char (buf1, ch);
                return; 
        }

Now, stick this just below the get_olc_tabla function:

/* Holds all the old tables */
const struct olc_cmd_type * get_olc_table2( int editor )
{
        switch(editor)
        {
                case ED_AREA:   return aedit_table;
                case ED_GROUP:  return gedit_table;
                case ED_HELP:   return hedit_table;
        }
        return NULL;
}


Reason why this fix is probably the best? Well, you don't have to update
oldstyle editors that you may throw in from snippets, and you don't have
the burdon of juggling duplicate tables when you add in new commands to
them.

Just my two cents.

Ammaross Danan


Reply via email to