Re: [CODE] do_dig modifications for OasisOLC

From: Peter Ajamian (
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:


> 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.


Regards, Peter

   | FAQ: |
   | Archives: |

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