Ok, that worked, but i'm getting an messed up output. This has been doing this since i've put it in, figured it might go away after i fixed that if statement. The first output is what happens when i first type mem, but the second output is when i type mem again.
You have memorized the following spells:
(level 5) blindness (x2)
And you are currently memorizing the following spells:
1 seconds ( 5) blindness.
21 seconds ( 5) blindness.
25 seconds ( 1) armor.
29 seconds ( 1) armor.
You can memorize, 10 1st, 9 2nd, 8 3rd, 8 4th, 3 5th, 6 6th, 6 7th, 6 8th, 5 9th level spell(s).
<1007hp 507m 1240mv>
< > mem
You have memorized the following spells:
You can memorize, 10 1st, 9 2nd, 8 312408 4txÍ" (level 5) blindness (x2)
And you are currently memorizing the following spells:
1 seconds ( 5) blindness.
21 seconds ( 5) blindness.
25 seconds ( 1) armor.
29 seconds ( 1) armor.
You can memorize, 10 1st, 9 2nd, 8 3rd, 8 4th, 3 5th, 6 6th, 6 7th, 6 8th, 5 9th level spell(s).
Here's the code for that part.
if (none)
sprintf(buf, "%sNone.\r\n\r\n", buf);
else
sprintf(buf, "%s\r\n", buf);
send_to_char(buf, ch);
if (ch->pcdata->memorizing[0] != 0)
{
strcpy(buf, "");
sprintf(buf, "%sAnd you are currently memorizing the following spells:\r\n", buf);
time_memming = ch->mem_time;
for (i = 0; i < MAX_MEM_SPELLS; i++)
{
if (ch->pcdata->memorizing != 0)
{
sprintf(buf, "%s %4d seconds (%2d) %s.\r\n",
buf,
time_memming,
skill_table[ch->pcdata->memorizing]->spell_level,
skill_table[ch->pcdata->memorizing]->name);
if (ch->pcdata->memorizing[i + 1] != 0)
time_memming += skill_table[ch->pcdata->memorizing[i + 1]]->spell_level * 4;
}
}
send_to_char(buf, ch);
}
strcpy(buf, "");
sprintf(buf, "%s\r\n&wYou can memorize", buf);
if (can_mem(ch, 1))
sprintf(buf, "%s, %d 1st", buf, free_spells(ch, 1));
if (can_mem(ch, 2))
sprintf(buf, "%s, %d 2nd", buf, free_spells(ch, 2));
if (can_mem(ch, 3))
sprintf(buf, "%s, %d 3rd", buf, free_spells(ch, 3));
if (can_mem(ch, 4))
sprintf(buf, "%s, %d 4th", buf, free_spells(ch, 4));
if (can_mem(ch, 5))
sprintf(buf, "%s, %d 5th", buf, free_spells(ch, 5));
if (can_mem(ch, 6))
sprintf(buf, "%s, %d 6th", buf, free_spells(ch, 6));
if (can_mem(ch, 7))
sprintf(buf, "%s, %d 7th", buf, free_spells(ch, 7));
if (can_mem(ch, 8))
sprintf(buf, "%s, %d 8th", buf, free_spells(ch, 8));
if (can_mem(ch, 9))
sprintf(buf, "%s, %d 9th", buf, free_spells(ch, 9));
sprintf(buf, "%s level spell(s).\r\n", buf);
send_to_char(buf, ch);
if ((ch->position == POS_RESTING) && (ch->mem_time > 0) && (!xIS_SET(ch->act, PLR_MEMING))) {
send_to_char("You continue memorizing.\r\n", ch);
xSET_BIT(ch->act, PLR_MEMING);
}
return;
Any thoughts? I figure there's an extra buf somewhere in there. |