This is how mine looks, it stops the fighting and then sets it up how it
should be
    stop_fighting( fch, FALSE );
    stop_fighting( victim, FALSE );

    check_killer( ch, fch );
    set_fighting( ch, fch );
    set_fighting( fch, ch );
    set_fighting(victim, fch);

This way, it keeps the ch fighting, just not getting hit. Did that cause we
would have mortal use rescue. And then backstab. Rescue and then backstab.
So we kept them fighting just not getting hit. Hopefully this helps.

----- Original Message -----
From: "Anarchangel" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Saturday, November 23, 2002 12:38 PM
Subject: Set_fighting and rescue


>
> Hey everyone,
>
> I'm just trying to clear up some of the BUG lines in my log files.  Right
> now I'm looking at set_fighting and rescue.
>
> Let's say I wander into a room of 5 enemies that assist each other.  I
> attack one, and naturally they all jump in.  If I use a pet or charmed mob
> to rescue myself, I get a line like this:
>
> BUG:  Set_fighting: pet already fighting mob
>
> This is of course at the beginning of set_fighting, like so:
>
>     if ( ch->fighting != NULL )
>     {
>         sprintf(buf, "BUG:  Set_fighting: %s already fighting %s",
> ch->name, victim->name );
>         log_string( buf );
>         return;
>     }
>
> I modified my bug string so that it tells the names rather than just
> "already fighting", so that let me know why it was complaining.  I
> narrowed it down to the end of do_rescue, like this:
>
>     set_fighting( ch, fch );
>     set_fighting( fch, ch );
>
> In this function we have fch, ch, and (further up) victim.  ch is pet,
> victim is the PC, and fch is whatever victim is fighting and wants to be
> rescued from.
>
> My question is, in stock ROM does this produce bug lines for anyone else,
> or does it make sure they're not fighting prior to that?  If it does
> produce BUG lines what have you done to correct it?  I just can't nail the
> logic without stop_fighting everyone and thus creating the "Screams and
> attacks" message.  I want to avoid this since it gives players the idea
> that another mob has joined the fight when that's not the case.  I don't
> want to modify set_fighting itself.  And I have gotten it "fixed" at one
> point, but it ended up with all mobs attacking my pet and none attacking
> me.  That's not what I want at all.
>
> Thanks,
>
> Jimmy
>
>
> --
> ROM mailing list
> [email protected]
> http://www.rom.org/cgi-bin/mailman/listinfo/rom
>
>


Reply via email to