Re: Problems with the Poll.patch

From: Welcor (welcor@dune.net)
Date: 03/24/02


From: "Kevin Dethlefs" <Demortes@MSN.COM>
> When I go to create a new one, the mud crashes, no logged events or
> anything. Just dies. Thanks in advance.

Have you run it through a debugger ?

To get some logged events, have you tried putting in log() statements[1]?
Like;

int setup_new_poll(struct char_data *ch, int pollnum)
 {
  int i = 0;
  bool node_assigned = FALSE;

  for (i = 0; i < MAX_POLL_LOOKS; i++)
    if ((POLL_LOOK_DESC(i) == NULL) && (node_assigned == FALSE))
    {
      POLL_LOOK_DESC(i) = ch->desc;
      POLL_LOOK(i) = pollnum;   /* 0 is the most recent */
      POLL_LOOK_MODE(i) = POLL_EDIT_MAIN;
      node_assigned = TRUE;
    }
+ log("setup_new_poll: got through for loop");
  if (node_assigned == FALSE)
  {
    send_to_char("Sorry, but all editing slots are full.  Try again
later.\r\n", ch);
    cleanup_poll_edit(ch->desc);
+ log("setup_new_poll: cleanup_poll_edit done - returning")
    return (-1);
  }
+ log("setup_new_poll: Starting setup of poll #%d", polls_top);
  polls_index[polls_top].number = pollnum;
  polls_index[polls_top].name= str_dup("New Poll");
  polls_index[polls_top].desc = str_dup("A New Poll");
  polls_index[polls_top].first_choice = str_dup("choice1");
  polls_index[polls_top].second_choice = str_dup("choice2");
  polls_index[polls_top].third_choice = str_dup("choice3");
  polls_index[polls_top].fourth_choice = str_dup("choice4");
  polls_index[polls_top].fifth_choice = str_dup("choice5");

  for (i=0; i<=4; i++)
    polls_index[polls_top].percents[i] = 0;

  polls_index[polls_top].is_new = TRUE;
  polls_index[polls_top].status = POLL_FUTURE;

+ log("setup_new_poll: Setup of poll #%d complete", polls_top);

  polls_top++;
  return 1;
}

This should give you an idea of why you're crashing.

Welcor

[1] log() is your friend. Use it before you use the mailing list.
    Often this will suffice, and lower the signal/noise ratio.

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   | Newbie List:  http://groups.yahoo.com/group/circle-newbies/   |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 06/25/03 PDT