Re: [idea]Floating Zone

From: Mike Carpenter (abram@DELTANET.COM)
Date: 02/18/98


>     DOH! i completely forgot the train snippet/patch that is out there.
it
>     makes a room look like a train by moving the exits of the train room
>     around.... silly me.  Take a peek at that.

Okay I looked a trains.c and it helped out, However, when i compile and run
the code
the mud crashes after someone logs on.  for some reason it seems to crash
at

word[entrance].dir_option[2]->to_room = first_room;
or any place a like statement is used.  I have included the source code for
what i have so far, can anyone help figure out why the mud will crash after
this function is called and
what i could do to fix it?

also i added in comm.c this line to call the function every 25 seconds
      if (!(pulse % (25 * 4)))
         floating_zone();


/* source for the floating zone */
void floating_zone()
{
        extern struct room_data *world;

        int first_room = real_room(3000); /* one of the random rooms */
        int second_room = real_room(3063); /* another of the rooms */
        int third_room = real_room(3006); /* another room */
        int entrance = real_room(3099); /* Entrance room to floating zone
*/

        switch(number(1,3))
        {
          case 1:
                /* connect entrance and first room */
                world[entrance].dir_option[0]->to_room = first_room;
                world[first_room].dir_option[2]->to_room = entrance;
                /* Close second and third room exits south */
                world[second_room].dir_option[2]->to_room = NOWHERE;
                world[third_room].dir_option[2]->to_room = NOWHERE;
                break;
          case 2:
                /* connect entrance and second room */
                world[entrance].dir_option[0]->to_room = second_room;
                world[second_room].dir_option[2]->to_room = entrance;
                /* Close first and third room exits south */
                world[first_room].dir_option[2]->to_room = NOWHERE;
                world[third_room].dir_option[2]->to_room = NOWHERE;
                break;
          case 3:
                /* connect entrance and third room */
                world[entrance].dir_option[0]->to_room = third_room;
                world[third_room].dir_option[2]->to_room = entrance;
                /* Close first and second room exits south */
                world[first_room].dir_option[2]->to_room = NOWHERE;
                world[second_room].dir_option[2]->to_room = NOWHERE;
                break;
          default:
                log("System Error in FLOATING_ZONE function!");
                break;
        }
return;
}


Thanks,
Abram


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