--- quake2/game/g_combat.c 2018/04/24 17:58:33 1.1 +++ quake2/game/g_combat.c 2018/04/24 17:59:01 1.1.1.2 @@ -294,6 +294,8 @@ void M_ReactToDamage (edict_t *targ, edi // if attacker is a client, get mad at them because he's good and we're not if (attacker->client) { + targ->monsterinfo.aiflags &= ~AI_SOUND_TARGET; + // this can only happen in coop (both new and old enemies are clients) // only switch if can't see the current enemy if (targ->enemy && targ->enemy->client) @@ -320,19 +322,26 @@ void M_ReactToDamage (edict_t *targ, edi (strcmp(attacker->classname, "monster_makron") != 0) && (strcmp(attacker->classname, "monster_jorg") != 0) ) { - if (targ->enemy) - if (targ->enemy->client) - targ->oldenemy = targ->enemy; + if (targ->enemy && targ->enemy->client) + targ->oldenemy = targ->enemy; + targ->enemy = attacker; + if (!(targ->monsterinfo.aiflags & AI_DUCKED)) + FoundTarget (targ); + } + // if they *meant* to shoot us, then shoot back + else if (attacker->enemy == targ) + { + if (targ->enemy && targ->enemy->client) + targ->oldenemy = targ->enemy; targ->enemy = attacker; if (!(targ->monsterinfo.aiflags & AI_DUCKED)) FoundTarget (targ); } - else - // otherwise get mad at whoever they are mad at (help our buddy) + // otherwise get mad at whoever they are mad at (help our buddy) unless it is us! + else if (attacker->enemy && attacker->enemy != targ) { - if (targ->enemy) - if (targ->enemy->client) - targ->oldenemy = targ->enemy; + if (targ->enemy && targ->enemy->client) + targ->oldenemy = targ->enemy; targ->enemy = attacker->enemy; if (!(targ->monsterinfo.aiflags & AI_DUCKED)) FoundTarget (targ);