Re: Error in Portal Spell

From: Bobby L. Russ (russ@eng.usf.edu)
Date: 08/18/00


At 8/18/2000 8:14:00 PM, you wrote:
>On Fri, 18 Aug 2000, Bobby L. Russ wrote:
>Try "print portal" in gdb.  Chances are it's 0x0 (NULL).  Not having more
>of the code around the GET_OBJ_VAL macro call, I can't tell you precisely
>why this would be so -- send the lines of the function up to line 445.
>
>-dak

You were right about that :-)  Alright...  What are you suggesting to fix this?  Thank you for your help so far and
I really appreciate it :-)

gdb's response to print portal:
(gdb) print portal
$1 = (struct obj_data *) 0x0

The code is...

#define PORTAL_OBJ  20

ASPELL(spell_portal)
{
  struct obj_data *portal, *tportal;
  struct extra_descr_data *new_descr, *new_tdescr;
  char buf[80];

  if (ch == NULL || victim == NULL)
    return;
  /* Create the Portal */
  portal = read_object(PORTAL_OBJ, VIRTUAL);
Line 445  GET_OBJ_VAL(portal, 0) = victim->in_room;
  GET_OBJ_TIMER(portal) = (int) (GET_LEVEL(ch) / 10);
  CREATE(new_descr, struct extra_descr_data, 1);
  new_descr->keyword = str_dup("portal gate gateway");
  sprintf(buf, "You can barely make out %s.", world[victim->in_room].name);
  new_descr->description = str_dup(buf);
  new_descr->next = portal->ex_description;
  portal->ex_description = new_descr;
  obj_to_room(portal, ch->in_room);


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