Re: Problems with the Poll.patch

From: Kevin Dethlefs (Demortes@msn.com)
Date: 03/24/02


Thanks to Daniel, and maybe Kras, I have gotten it to display, now I can't
create. Here is the code. Anyhelp is appreciated.


 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;
    }

  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);
    return (-1);
  }

  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;


  polls_top++;
  return 1;
}


When I go to create a new one, the mud crashes, no logged events or
anything. Just dies. Thanks in advance.

Totally crazy (and loving every minute of it),
Kevin

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