Re: Score command.

From: Daniel Koepke (dkoepke@california.com)
Date: 02/22/97


On Sat, 22 Feb 1997, Lew/Ryan Guthrie wrote:

>   sprintf(buf, "Hit p.:[%d/%d]  Mana p.:[%d/%d]  Move p.:[%d/%d]\r\n",
>           GET_HIT(ch), GET_MAX_HIT(ch), GET_MANA(ch),
>           GET_MAX_MANA(ch), GET_MOVE(ch), GET_MAX_MOVE(ch));

Put in the '%s' and corresponding 'buf' here so you don't loose the
"Score information for %s\r\n" line.

>   sprintf(buf, "Str: [%d/%d]  Int: [%d]  Wis: [%d]  "
>           "Dex: [%d]  Con: [%d]  Cha: [%d]\r\n",
>           GET_STR(ch), GET_ADD(ch), GET_INT(ch), GET_WIS(ch),
>           GET_DEX(ch), GET_CON(ch), GET_CHA(ch));

Put the '%s' and corresponding 'buf' here, too.

>   sprintf(buf2, "Lev: [%2d], XP: [%7d], Align: [%4d]\r\n",
>           GET_LEVEL(ch), GET_EXP(ch), GET_ALIGNMENT(ch));
>   strcat(buf, buf2);

Why are you doing this instead of using buf directly?

>   sprintf(buf, "%sStatus: ", buf);

Change this to "strcat(buf, "Status: ");" for efficiency.


--
Daniel Koepke
dkoepke@california.com
Forgive me father, for I am sin.


+-----------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
|   http://cspo.queensu.ca/~fletcher/Circle/list_faq.html   |
|    Or send 'info circle' to majordomo@cspo.queensu.ca     |
+-----------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/18/00 PST