Okay took your advice and did a little rework. Now summoned MOBs and charmed MOBs are assisting as they should, in my opinion.
I probably didn't need to go so far as to add a "MOB_ASSSIST" flag as a summoned mob is given "aff_charm"
So here it is both ways. Not that I looked at some act.offensive.c code and I got lazy and just kept the k variable concept. Probably didn't have to do that either. BUT it works fine for both charmed and summoned.
Code:
non mob_assist code
/* Auto-assist for charmed followers */
struct follow_type *k; /* Declared properly */
for (k = ch->followers; k; k = k->next) {
struct char_data *mob = k->follower;
if (IS_NPC(mob) && AFF_FLAGGED(mob, AFF_CHARM) &&
IN_ROOM(ch) == IN_ROOM(mob) && FIGHTING(ch) && !FIGHTING(mob)) {
log("DEBUG: %s auto-assisting master %s.", GET_NAME(mob), GET_NAME(ch));
do_assist(mob, GET_NAME(ch), 0, 0); /* Call do_assist to join master's fight */
} else {
log("DEBUG: %s not assisting %s: failed NPC, AFF_CHARM, same room, or not fighting check.",
GET_NAME(mob), GET_NAME(ch));
}
}
mob_assist code.
/* Auto-assist for charmed or MOB_ASSIST followers */
for (k = ch->followers; k; k = k->next) {
struct char_data *mob = k->follower;
if (IS_NPC(mob) && (MOB_FLAGGED(mob, MOB_ASSIST) || AFF_FLAGGED(mob, AFF_CHARM)) &&
IN_ROOM(ch) == IN_ROOM(mob) && FIGHTING(ch) && !FIGHTING(mob)) {
log("DEBUG: %s auto-assisting master %s.", GET_NAME(mob), GET_NAME(ch));
do_assist(mob, GET_NAME(ch), 0, 0); /* Call do_assist to join master's fight */
} else {
log("DEBUG: %s not assisting %s: failed NPC, MOB_ASSIST/AFF_CHARM, same room, or not fighting check.",
GET_NAME(mob), GET_NAME(ch));
}
}
I goes right after the group check and before the hit(ch, FIGHTING(ch), TYPE_UNDEFINED); line.
Thanks for the suggestions and help figuring this out.
ALWAYS much appreciated.