[CODE] Strange occurence

From: Christoffer Lundberg (avatar@ORION.BODEN.SE)
Date: 04/06/98


I have implemented a small code to summon a portal at a specific time
to a specific room. I have added a code in comm.c to check the
void-function elemental_portal every "tick". The elemental_portal
function is written like this:

void elemental_portal(void)
{
  struct obj_data *portal;
  struct time_info_data time_info;
  int room;

  room = number(4210, 4299);
  portal = read_object(4216, VIRTUAL);

  if (time_info.hours == 23) {
    sprintf(buf, "Elemental Portal appearing in room %d.", room);
    mudlog(buf, BRF, LVL_IMMORT, TRUE);
    obj_to_room(portal, room);
    send_to_room("The very fabric of space is ripped apart as a shimmering portal appears.\r\n", room);
  } else
    return;
}


Now comes the problem. At some times, the portal doesn't appear, and no
logging is made; and at some times, the MUD crashes, and shows

ERROR: Illegal values passed onto obj_to_room.

What can be causing this strange occurence?

>Christoffer


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