Re: [CODE] [LONG] need help with spec proc

From: Skylar (skylar@ifconfig.intserv.com)
Date: 09/29/96


On Sat, 28 Sep 1996, Sliver wrote:

> I'm writing a spec_proc for a mob that does implants, but I'm having a
> wierd problem
> The mud crashes whenever mix up the arguments, heres an example:

> and you type: implant legs
> it crashes

>       if (!(obj = get_obj_in_list_vis(ch, arg1, ch->carrying)) &&
> GET_OBJ_TYPE(obj) == ITEM_IMPLANT) {

Here's one problem, if your get_obj_in_list_vis() fails it STILL tries
to GET_OBJ_TYPE() on an object which you havnt located (i.e. NULL).  That
&& should probably be ||.

You really should go through that code and clean it up some though, it
LOOKS like there are some other problems, like some instances where you
are accessing arg2 before you've made sure you got a second arg at all
and whatnot... theres just a lot of if else'ing going on and its hard to
tell at certain points if you've made all the sanity checks you need to.


-Sky

+-----------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
|   http://cspo.queensu.ca/~fletcher/Circle/list_faq.html   |
+-----------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/18/00 PST