Re: [BUG] Snippet - Damaged Objects

From: Carlo Mocci (mocci@TIN.IT)
Date: 08/22/98

At 19.40 21/08/98 -0400, you wrote:
>I should probably write to the author of this only, but I thought since its
>on the snippets site I should paste it here too?
>Well I do everything the instructions say on the Damaged Objects snippet,
>when starting the MUD I am almost connected then the MUD crashes. I check
>Program terminated with signal 11, Segmentation fault.
>Cannot access memory at address 0x80b0080.
>#0  0x4514f in perform_violence () at fight.c:1185
>1185      if (ch->equipment[j]) {

Judging from what you posted, I think that you don't have a valid ch
pointer in this line.
In the bpl14 perform_violence, there is:

void perform_violence(void)
  struct char_data *ch;

  for (ch = combat_list; ch; ch = next_combat_list) {
    next_combat_list = ch->next_fighting;

It seems to me that this part is missing in your code (maybe it comes after ?)

Another idea, try adding a if (!IS_NPC(ch)) before accessing equipment (I
can't remember if it's valid to access mob's equipment that way...)

Carlo Mocci -

Coder of Dalila MUD 4000

     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | |

This archive was generated by hypermail 2b30 : 12/15/00 PST