Re: Bug in score.

From: Del (caminturn@earthlink.net)
Date: 09/20/00


Karl Buchner wrote:
>
> I wrote the following do_score function several weeks ago.  About half the
> time that it is used, it crashed.
> I have spent several hours trying to debug it, but I think there is
> something simple i am missing...any ideas?
>
> Blaize
>
> ACMD(do_score)
> {
>   if (IS_NPC(ch))
>     return;
>
>   sprintf(buf,
>     "&BRace: &W%s &BClass: &W%s &BLevel: &W%d\r\n"
>     "---------- ---------- ---------- ---------- ---------- ----------\r\n"
>     "&BLevel: &W%d\r\n"
>     "&BAge  : &W%d\r\n"
>     "&BSTR  : &W%d&B \tHitRoll: \t&W%d\r\n"
>     "&BINT  : &W%d&B \tDamRoll: \t&W%d\r\n"
>  "&BWIS  : &W%d&B\r\n"
>  "&BDEX  : &W%d&B \tAlign  : \t&W%d\r\n"
>  "&BCON  : &W%d&B \tAttks  : \t&W%d\r\n"
>  "&BCHA  : &W%d\r\n"
>  "&BEXP  : &W%d   \t&BHits: &W%d &Bof &W%d\r\n"
>  "&BPracs: &W%d   \t&BMana: &W%d &Bof &W%d\r\n"
>  "&BQuest: &W%d   \t&BMove: &W%d &Bof &W%d\r\n"
>  "&BGold : &W%d\r\n",
>  pc_race_types[(int) GET_RACE(ch)], pc_class_types[(int) GET_CLASS(ch)], GET_LEVEL(ch),
>  GET_LEVEL(ch),
>  GET_AGE(ch),
>  GET_STR(ch), GET_HITROLL(ch),
>  GET_INT(ch), GET_DAMROLL(ch),
>  GET_WIS(ch),
>  GET_DEX(ch), GET_ALIGNMENT(ch),
>  GET_CON(ch), NUM_ATTACKS(ch),
>  GET_CHA(ch),
>  GET_EXP(ch), GET_HIT(ch), GET_MAX_HIT(ch),
>  GET_PRACTICES(ch), GET_MANA(ch), GET_MAX_MANA(ch),
>  GET_QUESTPOINTS(ch), GET_MOVE(ch), GET_MAX_MOVE(ch),
>  GET_GOLD(ch));
>   send_to_char(buf, ch);
> }

Try deviding it in half: meaning buffer up to Dex, send_char
and send second half. See if that helps.
(might have a problem with the buf size (8192) and all those
color changes)


     +------------------------------------------------------------+
     | 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/11/01 PDT