Re: [Newbie][Code]Changing the eat command to check everything...

From: Jon A. Nielsen (nikolai@montana.com)
Date: 01/12/99


>if(arg = "all" || "ALL"){

Uhm, well, this'll have to look more like:
if (!strcmp(arg, "all") || !strcmp(arg, "ALL")) {

From there, just loop through ch's inventory, and if something is item type
food, eat that, and send the message to the room/character. You could
probably look at the "junk" or "sacrifice" code. (I can't remember if it's
stock
or not, though...)

(You may be able to do "if (arg == "all")" if arg is a class other than
(char *)
that has an operator==() function defined, though...)

-Jon.


     +------------------------------------------------------------+
     | 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 : 12/15/00 PST