Player B has auto assist on.
Player B is not autoassisting the charmie it keeps saying No on here by that name.
Code:
ACMD(do_assist)
{
char arg[MAX_INPUT_LENGTH];
struct char_data *helpee, *opponent;
if (ROOM_FLAGGED(IN_ROOM(ch), ROOM_PEACEFUL)) {
send_to_char(ch, "%s", PEACE_ROOM_WARNING);
return;
}
if (FIGHTING(ch)) {
send_to_char(ch, "You're already fighting! How can you assist someone else?\r\n");
return;
}
one_argument(argument, arg);
if (!*arg)
send_to_char(ch, "Whom do you wish to assist?\r\n");
else if (!(helpee = get_char_room_vis(ch, arg)))
send_to_char(ch, "%s", CONFIG_NOPERSON);
else if (helpee == ch)
send_to_char(ch, "You can't help yourself any more than this!\r\n");
else if (GET_POS(helpee) != POS_FIGHTING)
act("But nobody is fighting $M!", FALSE, ch, 0, helpee, TO_CHAR);
else {
/*
* Hit the same enemy the person you're helping is.
*/
if (FIGHTING(helpee))
opponent = FIGHTING(helpee);
else
for (opponent = world[IN_ROOM(ch)].people; opponent && (FIGHTING(opponent) != helpee);
opponent = opponent->next_in_room)
;
if (!opponent)
act("But nobody is fighting $M!", FALSE, ch, 0, helpee, TO_CHAR);
else if (!CAN_SEE(ch, opponent))
act("You can't see who is fighting $M!", FALSE, ch, 0, helpee, TO_CHAR);
/* prevent accidental pkill */
else if (IS_PC(opponent) && IS_PC(ch) && !ROOM_FLAGGED(IN_ROOM(ch), ROOM_ARENA))
act("Go to the Arena if you really want to attack $N.", FALSE,
(AFF_FLAGGED(ch, AFF_CHARM) ? ch->master : ch), 0, opponent, TO_CHAR);
else if (GET_POS(opponent) == POS_DEAD)
return;
else if (IN_ROOM(ch) != IN_ROOM(opponent))
return;
else {
send_to_char(ch, "Banzai! You join in the fight...\r\n");
act("$N assists you!", 0, helpee, 0, ch, TO_CHAR);
act("$n assists $N.", FALSE, ch, 0, helpee, TO_NOTVICT);
hit_with_wielded_weapon(ch, opponent, TYPE_UNDEFINED);
}
}
return;
}
Code:
/* auto-assist */
if (GROUP(ch) && GROUP(ch)->members && GROUP(ch)->members->iSize) {
struct iterator_data Iterator;
tch = (struct char_data *) merge_iterator(&Iterator, GROUP(ch)->members);
for (; tch ; tch = next_in_list(&Iterator)) {
if (tch == ch)
continue;
if (!IS_NPC(tch) && !PRF_FLAGGED(tch, PRF_AUTOASSIST))
continue;
if (IN_ROOM(ch) != IN_ROOM(tch))
continue;
if (FIGHTING(tch))
continue;
if (GET_POS(tch) != POS_STANDING)
continue;
if (!CAN_SEE(tch, ch))
continue;
do_assist(tch, GET_NAME(ch), 0, 0);
}
}
if (!IS_NPC(ch) && GROUP(ch)) {
for (struct follow_type *k = ch->followers; k; k = k->next) {
/* should followers auto-assist master? */
/* New Method, check made on if a mobile or player is attempting an auto-assist.
Created to address SYSERR: Mob using
'((k->follower)->player_specials->saved.pref)' at fight.c:2598. Jason Phillips
3/29/2020 */
if (!IS_NPC(k->follower) && !FIGHTING(k->follower)
&& AFF_FLAGGED(k->follower, AFF_GROUP) && PRF_FLAGGED(k->follower, PRF_AUTOASSIST)
&& (k->follower->in_room == ch->in_room) && (GET_POS(k->follower) == POS_STANDING))
do_assist(k->follower, GET_NAME(ch), 0, 0);
}
/* should master auto-assist followers? */
if (ch->master && !IS_NPC(ch->master) && FIGHTING(ch) && !FIGHTING(ch->master)
&& AFF_FLAGGED(ch->master, AFF_GROUP) && PRF_FLAGGED(ch->master, PRF_AUTOASSIST)
&& (ch->master->in_room == ch->in_room) && (GET_POS(ch->master) == POS_STANDING))
do_assist(ch->master, GET_NAME(ch), 0, 0);
}