As a gag the other day on a MUD I frequent, I thought I'd have a look and see if I could get myself out of a fight by trying to rescue my attacker. This did not go so well... It worked, but I can safely say that I took too long to realize I was kicking my ass.
This presents two problems, one which I have the fix for.
In skills.c, in function do_rescue(), find the following:
if( ( fch = who_fighting( victim ) ) == NULL )
{
send_to_char( "They are not fighting right now.\r\n", ch );
return;
}
ch->alignment = ch->alignment + 5;
ch->alignment = URANGE( -1000, ch->alignment, 1000 );
Directly BEFORE that, add the following:
if( ( fch = who_fighting( victim ) ) == ch )
{
send_to_char( "One would imagine THEY don't need your help.\r\n", ch );
return;
}
The second problem is... Why are multi_hit and one_hit allowing ch == victim? That makes no sense. I'm not sure about set_fighting... I don't think it should allow ch == victim, but I'm not absolutely sure about it. Damage should probably be the only such function that allows ch == victim... You shouldn't be able to carry a round of combat against yourself. That just seems absurd to me.