Hello,

I'm sure this has been mentioned in the archives, but
romlist.the-infinite.org isn't working and I forgot the non-subdomain
link.

Anyway, here's some backup info.  The mud I'm doing some work for
implemented a remort system awhile back, and as far as I can tell it's
working alright.  The problem seems to lie in the group_add function or
something similar.  For one of our races we give the benedictions
group as a race-based skill.  Sometimes it will work and sometimes it
won't.. I'm thinking it may be reliant on whatever the person remorted
from, but that doesn't seem to add up.

In the remort function it just uses a system like the stock nanny.  First
you go into CON_CONFIRM_REMORT, which resets and initializes the
character.  All of ch->pcdata->learned[sn] is set to 0.  It then asks for
the race, like normal, and puts the player into con_get_new_race.  It
checks for acceptable input and then sets ch->race =
race_lookup(argument).  Like I said, the remort function basically works
so the character is being set to the race, class and everything like
normal.

A little further down, skills are added for the races.

        for (i = 0; i < 5; i++)
        {
            if (pc_race_table[race].skills[i] == NULL)
                break;
            group_add(ch,pc_race_table[race].skills[i], FALSE);
        }   

Here's the code for group_add:

void group_add( CHAR_DATA *ch, const char *name, bool deduct)
{    
    int sn,gn;   
     
    if (IS_NPC(ch)) /* NPCs do not have skills */
        return;
            
    sn = skill_lookup(name);
                
    if (sn != -1)
    {
        if (ch->pcdata->learned[sn] == 0 &&
(skill_table[sn].learn[ch->class] > 0 || skill_table[sn].spell_fun == 
            spell_null)) /* i.e. not known */
        {
            ch->pcdata->learned[sn] = 1;
            if (deduct)
                ch->pcdata->points += skill_table[sn].rating[ch->class];
        }
        return;
    }
    
    /* now check groups */
    
    gn = group_lookup(name);
    
    if (gn != -1)
    {
        if (ch->pcdata->group_known[gn] == FALSE)
        { 
            ch->pcdata->group_known[gn] = TRUE;
            if (deduct)
                ch->pcdata->points += group_table[gn].rating[ch->class];
        }
        gn_add(ch,gn); /* make sure all skills in the group are known */
    }
}


I put a send_to_char in both the gn and the sn check for -1, and both of
them are in fact being used.. so it's not a matter of me misspelling the
spell or whatnot.  It does find it.  Here's the code for gn_add:

void gn_add( CHAR_DATA *ch, int gn)
{
    int i;
     
    ch->pcdata->group_known[gn] = TRUE;
    for ( i = 0; i < MAX_IN_GROUP; i++)
    {
        if (group_table[gn].spells[i] == NULL)
            break;  
        group_add(ch,group_table[gn].spells[i],FALSE);
    }       
}



I'm sure this is something simple that I'm missing, like a logic
problem.  But I've been looking things over for the last week and just
can't nail it down.

Any help would be appreciated, or if nothing else maybe a link to the
archives.

Thanks much,
Jimmy


Reply via email to