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