Hi List...
I was attempting to place in the following "award" code. Basically, I
need it to award the # of questpoints (buf) to the character (arg). It
works, no crashes, etc...logs it fine. But it's not *adding* the value to
the character's total...
***SNIP***
ACMD(do_award)
{
struct char_data *victim;
int newquest;
half_chop(argument, buf, arg);
if (!*arg || !*buf || !isdigit(*buf))
send_to_char("Syntax: award <amount> <character>.\r\n", ch);
else if (!(victim = get_char_vis(ch, arg)))
send_to_char("No one by that name here.\r\n", ch);
else if (victim == ch)
send_to_char("Are you sure you're feeling ok?\r\n", ch);
else if (GET_LEVEL(victim) > GET_LEVEL(ch))
send_to_char("That's really not such a good idea.\r\n", ch);
else {
newquest = atoi(buf);
if (newquest > 0) {
GET_QPOINTS(victim) == GET_QPOINTS(victim) + newquest;
act("$n begins to gesture and signal strange symbols.\r\n"
"A magical force comes and lifts you up, drifting\r\n"
"within the clouds.", FALSE, ch, 0, victim, TO_VICT);
sprintf(buf1, "\r\nYou have been awarded %d questpoints!\r\n",
newquest);
send_to_char(buf1, victim);
} else {
GET_QPOINTS(victim) == GET_QPOINTS(victim) - newquest;
act("$n begins to gesture and signal strange\r\n"
"symbols. An unholy force comes and drops\r\n"
"you into oblivion.", FALSE, ch, 0, victim, TO_VICT);
sprintf(buf1, "\r\nYour questpoint total has been reduced by
%d.\r\n", newquest);
send_to_char(buf1, victim);
}
sprintf(buf1, "Your current total is now: %d questpoints.\r\n",
GET_QPOINTS(victim));
send_to_char(buf1, victim);
sprintf(buf1, "%s awarded %s %d questpoints. (Tot: %d)",
GET_NAME(ch), GET_NAME(victim), newquest, GET_QPOINTS(victim));
mudlog(buf1, BRF, LVL_GOD, TRUE);
send_to_char(OK, ch);
save_char(victim, NOWHERE);
}
}
***END SNIP***
Logs say "Caniffe awarded Saxen 3 questpoints. (Tot: 0)" in the final
section of this code.
Me thinks there's prolly something *very* simplistic I'm missing, but I
can't see it. Can anyone assist/point me in the right direction?
-----------------------------------------------------------------
Julian Buckley, 2nd Year Computer Systems Engineering
Dept. Computer Science and Electrical Engineering, Univ. of Qld
E-Mail: s348266@student.uq.edu.au
Web Page: http://student.uq.edu.au/~s348266/index.html
-----------------------------------------------------------------
+------------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
| http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
+------------------------------------------------------------+
This archive was generated by hypermail 2b30 : 12/15/00 PST