clue me in plz....

[fradmin:~/fr/src]: make
02:31:48 : Compiling act_info.c...
act_info.c: In function 'void do_affects (CHAR_DATA *, const char *):
act_info.c:1745: warning: 'AFFECT_DATA *paf' might be used
uninitialized in this function
Done.
[fradmin:~/fr/src]: 

also here is the whole function, it is also crashing the mud?

formating sucks with this mailcity/lycos crap but here goes

----- CODE SNIP -----
CH_CMD (do_affects)
{
    AFFECT_DATA *paf, *paf_last = NULL;   // <<<< LINE 1745 >>>>
    char buf[MAX_STRING_LENGTH];
    bool        aFound = FALSE;
    int         wear_loc = 0;
    long        imm = 0, res = 0, vuln = 0, aff = 0;
    OBJ_DATA *obj;

    if (ch->affected != NULL)
    {
        aFound = TRUE;

        chprintln (ch, "Spells:");
        for (paf = ch->affected; paf != NULL; paf = paf->next)
        {
            if (paf_last != NULL && paf->type == paf_last->type)
                if (ch->level >= 20)
                    chprint (ch, "                      ");
                else
                    continue;
            else
                chprintf (ch, "Spell: %-15s", skill_table[paf->type].name);

            if (ch->level >= 20)
            {
                sprintf (buf, ": modifies %s by %d ", flag_string (apply_flags, 
paf->location),  paf->modifier);
                chprint (ch, buf);
                if (paf->duration == -1)
                    chprint (ch, "permanently");
                else
                    chprintf (ch, "for %d hours\n\r", paf->duration);
            }
            paf_last = paf;
        }
    }
    for (wear_loc = WEAR_LIGHT; wear_loc < MAX_WEAR -1 ; wear_loc++)
    {
        if ((obj = get_eq_char(ch, wear_loc)) != NULL)
        {
            for (paf = obj->pIndexData->affected; paf != NULL; paf = paf->next)
            {
                if (paf->bitvector) switch (paf->where)
                {
                    case TO_AFFECTS: SET_BIT(aff,paf->bitvector ); break;
                    case TO_IMMUNE:  SET_BIT(imm,paf->bitvector ); break;
                    case TO_RESIST:  SET_BIT(res,paf->bitvector ); break;
                    case TO_VULN:    SET_BIT(vuln,paf->bitvector); break;
                    default:     break;
                }
            }
            for (paf = obj->affected; paf != NULL; paf = paf->next)
            {
                if (paf->bitvector) switch (paf->where)
                {
                    case TO_AFFECTS: SET_BIT(aff,paf->bitvector ); break;
                    case TO_IMMUNE:  SET_BIT(imm,paf->bitvector ); break;
                    case TO_RESIST:  SET_BIT(res,paf->bitvector ); break;
                    case TO_VULN:    SET_BIT(vuln,paf->bitvector); break;
                    default:     break;
                }
            }
        }
    }

    SET_BIT(imm, ch->imm_flags );
    SET_BIT(res, ch->res_flags );
    SET_BIT(vuln,ch->vuln_flags);

    if (imm != 0 || res != 0 || vuln != 0) aFound = TRUE;

    if (aff>0) chprintlnf(ch,"{GEquipment affects:{x\n\r%s",flag_string 
(affect_flags, paf->bitvector));
    if (imm>0) chprintlnf(ch,"{GImmunities:{x\n\r%s",flag_string (imm_flags, 
paf->bitvector));
    if (res>0) chprintlnf(ch,"{GResistants:{x\n\r%s",flag_string (res_flags, 
paf->bitvector));
    if (vuln>0) chprintlnf(ch,"{GVulnerables:{x\n\r%s",flag_string (vuln_flags, 
paf->bitvector));

//    {
//      if (aff>0)
//      {
//          sprintf(buf1,"{GYour equipment have these affects on you:{x%s", 
flag_string (affect_flags, paf->bitvector));
//          chprintln (ch,buf1);
//      }
//
//      if (imm>0)
//      {
//          sprintf(buf2,"{GYou are immune to:{x%s", flag_string (imm_flags, 
paf->bitvector));
//          chprintln (ch,buf2);
//      }
//
//      if (res>0)
//      {
//          sprintf(buf3,""{GYou are resistant to:{x%s", flag_string 
(imm_flags, paf->bitvector));
//          chprintln (ch,buf3);
//      }
//
//      if (vuln>0)
//      {
//          sprintf(buf4,"{GYou are vulnerable to:{x%s", flag_string 
(imm_flags, paf->bitvector));
//          chprintln (ch,buf4);
//      }
//    }

    if (!aFound) chprintln(ch,"You are not affected by any spells.");

    return;
}
----- END CODE SNIP -----
Any help plz. give a 200 gold coins :)



_____________________________________________________________
Get 25MB, POP3, Spam Filtering with LYCOS MAIL PLUS for $19.95/year.
http://login.mail.lycos.com/brandPage.shtml?pageId=plus&ref=lmtplus

Reply via email to