Re: [NEWBIE][CODE]Autosac

From: Jimmie Tryon (zereth@EARTHLINK.NET)
Date: 12/23/02

I'm still working on the command..haven't found out the problem.

'What do you want to sacrifice?'

   struct obj_data *obj;
   // note, I like to take care of no arg and wrong args up front, not
   // at the end of a function, let's get the wrongness out of the way

   if (!*argument)
     send_to_char(ch, "What do you wish to sacrifice?\n\r");
   // if it's not in the room, we're not going to sac it
   if (!(obj = get_obj_in_list_vis(ch, argument, NULL, world[ch-
>in_room].contents)))   {
     send_to_char(ch, "You don't see that here.\n\r");
   // cool, got the object in the room, now check its flags
   if (!CAN_WEAR(obj, ITEM_WEAR_TAKE))
     send_to_char(ch, "You can't sacrifice THAT!\n\r");
   // seems as if everything checks out ok
   act("$n sacrifices $p.", FALSE, ch, obj, 0, TO_ROOM);
   act("You sacrifice $p.", FALSE, ch, obj, 0, TO_CHAR);

Can you help me out?

   | FAQ: |
   | Archives: |
   | Newbie List:   |

This archive was generated by hypermail 2b30 : 06/25/03 PDT