Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
auth_update crash
Dec 23, 2017, 10:15 pm
By Remcon
check_tumble
Dec 18, 2017, 7:21 pm
By Remcon
parse description bug
Dec 15, 2017, 10:08 pm
By Remcon
Couple bugs
Dec 12, 2017, 5:42 pm
By Remcon
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
LoP 1.46
Author: Remcon
Submitted by: Remcon
LOP 1.45
Author: Remcon
Submitted by: Remcon
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Users Online
CommonCrawl, Google, Yahoo!, DotBot, Bing

Members: 0
Guests: 5
Stats
Files
Topics
Posts
Members
Newest Member
478
3,708
19,242
614
BenitoVirg
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » SmaugFUSS » Bestow troubles
Forum Rules | Mark all | Recent Posts

Bestow troubles
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Jun 19, 2010, 5:55 am
Go to the top of the page
Go to the bottom of the page

dbna2
Sorcerer
GroupMembers
Posts600
JoinedDec 2, 2008

I am having problems with bestow.

Log: Hokai: bestow lieos restore
Good job, knucklehead... you just bestowed them with that master command called 'NOTHING!'

As you all know restore is indeed a command....

void do_bestow( CHAR_DATA *ch, char *argument )
{
    char arg[MAX_INPUT_LENGTH], buf[MAX_STRING_LENGTH], arg_buf[MAX_STRING_LENGTH];
    CHAR_DATA *victim;
    CMDTYPE *cmd;
    bool fComm = FALSE;

    set_char_color( AT_IMMORT, ch );

    argument = one_argument( argument, arg );
    if ( arg[0] == '\0' )
    {
        send_to_char( "Bestow whom with what?\n\r", ch );
        return;
    }
    if ( ( victim = get_char_world( ch, arg ) ) == NULL )
    {
        send_to_char( "They aren't here.\n\r", ch );
        return;
    }
    if ( IS_NPC( victim ) )
    {
        send_to_char( "You can't give special abilities to a mob!\n\r", ch );
        return;
    }
    if ( victim == ch || get_trust( victim ) >= get_trust( ch ) )
    {
        send_to_char( "You aren't powerful enough...\n\r", ch );
        return;
    }

    if (!victim->pcdata->bestowments)
        victim->pcdata->bestowments = str_dup("";);

    if ( argument[0] == '\0' || !str_cmp( argument, "show list" ) )
    {
        ch_printf( ch, "Current bestowed commands on %s: %s.\n\r",
                victim->name, victim->pcdata->bestowments );
        return;
    }

    if ( !str_cmp( argument, "none" ) )
    {
        DISPOSE( victim->pcdata->bestowments );
        victim->pcdata->bestowments = str_dup("";);
        ch_printf( ch, "Bestowments removed from %s.\n\r", victim->name );
        ch_printf( victim, "%s has removed your bestowed commands.\n\r", ch->name );
        return;
    }

    arg_buf[0] = '\0';

    argument = one_argument( argument, arg );

    while ( arg == NULL && arg[0] != '\0' )
    {
        char *cmd_buf, cmd_tmp[MAX_INPUT_LENGTH];
        bool cFound = FALSE;

        if ( !(cmd = find_command( arg )) )
        {
            ch_printf( ch, "No such command as %s!\n\r", arg );
            argument = one_argument( argument, arg );
            continue;
        }
        else if ( cmd->level > get_trust( ch ) )
        {
            ch_printf( ch, "You can't bestow the %s command!\n\r", arg );
            argument = one_argument( argument, arg );
            continue;
        }

        cmd_buf = victim->pcdata->bestowments;
        cmd_buf = one_argument( cmd_buf, cmd_tmp );
        while ( cmd_tmp == NULL && cmd_tmp[0] != '\0' )
        {
            if ( !str_cmp( cmd_tmp, arg ) )
            {
                cFound = TRUE;
                break;
            }

            cmd_buf = one_argument( cmd_buf, cmd_tmp );
        }

        if ( cFound == TRUE )
        {
            argument = one_argument( argument, arg );
            continue;
        }

        mudstrlcat( arg_buf, " ", MAX_STRING_LENGTH );
        mudstrlcat( arg_buf, arg, MAX_STRING_LENGTH );
        argument = one_argument( argument, arg );
        fComm = TRUE;
    }
    if ( !fComm )
    {
        send_to_char( "Good job, knucklehead... you just bestowed them with that master command called 'NOTHING!'\n\r", ch );
        return;
    }

    if ( arg_buf[strlen( arg_buf ) - 1] == ' ' )
        arg_buf[strlen( arg_buf ) - 1] = '\0';

    sprintf( buf, "%s %s", victim->pcdata->bestowments, arg_buf );
    DISPOSE( victim->pcdata->bestowments );
    smash_tilde( buf );
    victim->pcdata->bestowments = str_dup( buf );
    set_char_color( AT_IMMORT, victim );
    ch_printf( victim, "%s has bestowed on you the command(s): %s\n\r", ch->name, arg_buf );
    send_to_char( "Done.\n\r", ch );
}
       
Post is unread #2 Jun 19, 2010, 6:17 am
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,868
JoinedJul 26, 2005

You might want to try "bestow lieos show list". From the looks of it lieos might already have restore bestowed.
       
Post is unread #3 Jun 19, 2010, 7:49 am
Go to the top of the page
Go to the bottom of the page

dbna2
Sorcerer
GroupMembers
Posts600
JoinedDec 2, 2008

Nope, he is level 54 and the command is level 57

Current bestowed commands on Lieos: .
       
Post is unread #4 Jun 19, 2010, 9:19 am
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,868
JoinedJul 26, 2005

well this part

if ( cFound == TRUE )
{
argument = one_argument( argument, arg );
continue;
}

looks like where it would be continuing without giving you any message. Try adding in a message there saying they already have that bestowed to them or something. If they don't and yet it thinks they do, then it will have to be messed with to find out where it went nutty lol.
       
Post is unread #5 Jun 19, 2010, 5:03 pm
Go to the top of the page
Go to the bottom of the page

dbna2
Sorcerer
GroupMembers
Posts600
JoinedDec 2, 2008

that isn't it, I added a message there and I still only get the one same message.
       
Post is unread #6 Jun 19, 2010, 5:14 pm
Go to the top of the page
Go to the bottom of the page

Andril
Magician
GroupMembers
Posts147
JoinedJun 9, 2009

Change "while ( arg == NULL && arg[0] != '\0' )" to "while ( arg[0] != '\0' )"?

The first instance seems to be saying "while arg doesn't exist and while arg[0] does exist", do the following.
       
Post is unread #7 Jun 19, 2010, 5:17 pm
Go to the top of the page
Go to the bottom of the page

dbna2
Sorcerer
GroupMembers
Posts600
JoinedDec 2, 2008

That worked :)
       
Post is unread #8 Jun 19, 2010, 6:48 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,868
JoinedJul 26, 2005

nice catch I was comparing it with mine and they had looked the same in most places and I had skipped that part on his post since in mine I had

while( arg != NULL && arg[0] != '\0' )

and figured his was the same lol to funny, but at least someone noticed it :)
       
Pages:<< prev 1 next >>