Re: Error in Portal Spell

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


"Bobby L. Russ" wrote:
>
>   /* Create the Portal */
>   portal = read_object(PORTAL_OBJ, VIRTUAL);
> Line 445  GET_OBJ_VAL(portal, 0) = victim->in_room;

From read_object:

  if (type == VIRTUAL) {
    if ((i = real_object(nr)) < 0) {
      log("Object (V) %d does not exist in database.", nr);
      return NULL;
    }

Are you getting this error in the syslog?  If the object vnum is not
valid then read_object will return NULL.  You need to test for the NULL
value before doing anything with it that might crash the game.

Regards, Peter


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



This archive was generated by hypermail 2b30 : 04/11/01 PDT