do_kill_switching.c
snippets · 871 B · 2010-03-30
do_kill switching: changes in fight.c for do_kill when switching targets in combat.
Download « Back to the snippets list
in the function do_kill in fight.c find
if( ch->position == POS_FIGHTING
|| ch->position == POS_EVASIVE
|| ch->position == POS_DEFENSIVE || ch->position == POS_AGGRESSIVE || ch->position == POS_BERSERK )
{
send_to_char( "You do the best you can!\r\n", ch );
return;
}
change that to this
/* Handle if they are already fighting */
if( ch->fighting )
{
/* No point in fighting someone you are already fighting */
if( ch->fighting->who == victim )
{
send_to_char( "You do the best you can!\r\n", ch );
return;
}
/* Stop attacking current victim and attack a new one */
stop_fighting( ch, false );
}
That should allow them to switch who they are aiming their normal hits at with probably
the least amount of code.
Hope someone finds that useful.