Re: [CODE] do_dig modifications for OasisOLC

From: Peter Ajamian (peter@pajamian.dhs.org)
Date: 01/08/01


"Daniel A. Koepke" wrote:
>
> On Mon, 8 Jan 2001, Peter Ajamian wrote:
>
> > If you want builders to be able to use dig dig to change existing exits
> > this is where you would put in a check like the following...
>
> I would also remove the code to set the exit's general description and
> keyword to NULL, since you'll lose reference to the strings allocated
> there if you use 'dig' to redirect.  CREATE uses calloc(), which will zero
> out the memory for you anyway (and NULL is 0).

Actually that's not true, an implementaion must convert 0 to a NULL
pointer when an implicit caste is made however, it does not have to
store NULL as 0 in memory.  While most implementations probably store a
NULL pointer as zero that is by no means guaranteed.  This is fairly
well discussed in the comp.lanf.c FAQ here:

http://www.eskimo.com/~scs/C-faq/s5.html

also...

http://www.eskimo.com/~scs/C-faq/q7.31.html

> You could also free the
> strings if they're already allocated and then set them to NULL, but I
> don't particularly like that idea since that means your builder could lose
> an exit's description by making a typo with the 'dig' command.
>
That reminds me of another point, you should probably add checks to make
ceartain that both the source and target rooms are within the builder's
assigned zone, otherwise you'll end up with a newbie builder (or a
malicious builder) messing up all your zones that have been completed
and already tested.

> BTW, the original poster shouldn't stress over so many messages over his
> code.  At least he's putting something back into the community, and it's a
> lot better than citing copyright law.  So, really, thanks to him, and
> thanks to everyone else for helping him.

Agreed.

Regards, Peter

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/03/01 PST