Re: [BPL14][Newbie] Train Snippet

From: Tony Robbins [Kupek] (tonyr@NWPACLINK.COM)
Date: 09/09/98


Ok, ok, ok.

I wasn't very clear.

In the world structure, the dir_option[direction] consists of more than
just a target room.  For example, door names, door flags, and the string
sent to the player when they look in the direction.  The to_room of an
exit can be NOWHERE, and yet some of the remaining data still exist in the
directory structure--namely, the exit description.

If the exit doesn't exist at all (no strings, no flags, no door names, no
key, no 'to room'), you can't set data in it.  The MUD only allocates
memory for existant exits, so if the exit doesn't exist, you can't set
anything on it.

A way to fix this would be :
if (!world[rnum_of_room].dir_option[direction]) {
  CREATE(world[rnum_of_room].dir_option[direction], struct room_exit_data, 1);
  /* The `room_exit_data' is a fallacy.  The true room struct can be found
     in structs.h */
  ...initialize some vars...
}
...do your stuff...

[-------------------------------------------]
  Tony Robbins, <tonyr@nwpaclink.com>
  LakeView Technologies, Inc.
[-------------------------------------------]

On Wed, 9 Sep 1998, Scorn wrote:

> Isnt that the point, i mean it is a train like deal so the exit shouldnt go
> anywhere? right?  Or to put it better there shouldnt be any exits the train
> code is supposed to toggle the exits every 25 seconds.  Or maybe i didnt
> understand what you were saying.
> Scorn


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



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