Re: fighting list

From: Hades (
Date: 06/26/96

> Okay, I'm confused...i have a skill called haymaker which attempts to 
> knock out the opponent.  Once knocked out, everyone fighting the opponent 
> stops fighting.  This is what I have:
> if (!(percent > prob)) 
>   {
>     damage(ch, vict, 1, SKILL_HAYMAKER);

This does 1 damage, you realize this right?


This puts the haymaker doer asleep, not the target :)

>     for (k = combat_list; k; k = temp)
>     {
>        temp = k->next_fighting;
>        if (FIGHTING(k) == ch)
>          stop_fighting(k);
>     }
>   } 
>   else
>     damage(ch, vict, 0, SKILL_HAYMAKER);

combat_list is a linked list.

Aah I see your bug. If the person in the list that is fighting is fighting
ch, then stop k from fighting right? The VICT went to sleep... you wanna
stop everyone fighting VICT, not ch. if in the room there is MOBX and bob,
mark and tom, all fighting MOBX, and bob haymakers MOBX, that function will
stop everyone in the world that is fighting bob to stop fighting. 2
problems: the first is evident... mark and tom keep beating on MOBX. 2) It
never stops bob from fighting. Dont forget a stop_fighting(ch) in there as

Hades the eternal flame.

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