Hello there. Playing around with a small 'vending machine' object
special. Having quite a bit of trouble after extracting the argument to the
buy command.
At the top of the function I have declared...
char itm_name[MAX_INPUT_LENGTH]
<snip>
Further along we find the code giving me trouble...
else if (CMD_IS("buy")) {
argument = one_argument(argument, itm_name);
if (itm_name=="brown") {
itm_vnum=1200;
itm_cost=1000; }
else if (itm_name=="white") {
itm_vnum=1201;
itm_cost=9000; }
else if (itm_name=="black") {
itm_vnum=1202;
itm_cost=9000; }
else {
send_to_char("There is no such item.\r\n",ch);
return (TRUE);
}
code continues...
Now I know itm_name contains the argument entered, since I printed it
out within the function via a little send_to_char(can_name,ch); function.
Why the individual conditional statements never evaluate to true, I
can't figure out for the life of me. It invariably falls down and executes
the else/default chunk, displaying, 'there is no such item.'
Heh, I was so happy. My first attempt at a scratch piece of circle
code. It compiled clean, the loading of an object into a char's inventory,
etc, everything worked. Almost as big of a letdown as the Eagles/Cowgirls
game but
not quite.
If someone out there could please give me a clue, I'd appreciate it.
-jac 'If there were a version of circle written in RPG/400, I'd fare better :)'
betterbox.gameon.net 4000
+------------------------------------------------------------+
| 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/08/00 PST