diff --git a/src/p_enemy.cpp b/src/p_enemy.cpp index 8aed0370e..cd986b5f2 100644 --- a/src/p_enemy.cpp +++ b/src/p_enemy.cpp @@ -250,6 +250,9 @@ void P_NoiseAlert (AActor *target, AActor *emitter, bool splash, double maxdist) if (emitter == NULL) return; + /*if (target != NULL && target->player && !(target->flags & MF_FRIENDLY)) + return;*/ + if (target != NULL && target->player && (target->player->cheats & CF_NOTARGET)) return; @@ -1883,6 +1886,9 @@ bool P_LookForPlayers (AActor *actor, INTBOOL allaround, FLookExParams *params) if (!(player->mo->flags & MF_SHOOTABLE)) continue; // not shootable (observer or dead) + if (!((actor->flags ^ player->mo->flags) & MF_FRIENDLY)) + continue; // same +MF_FRIENDLY, ignore + if (player->cheats & CF_NOTARGET) continue; // no target @@ -1982,7 +1988,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_Look) targ = NULL; } - if (targ && targ->player && (targ->player->cheats & CF_NOTARGET)) + if (targ && targ->player && ((targ->player->cheats & CF_NOTARGET) || !(targ->flags & MF_FRIENDLY))) { return 0; } diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index c175858de..5c7b0ce7b 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -7354,6 +7354,9 @@ bool AActor::IsFriend (AActor *other) other->FriendPlayer == 0 || players[FriendPlayer-1].mo->IsTeammate(players[other->FriendPlayer-1].mo); } + // [SP] If friendly flags match, then they are on the same team. + /*if (!((flags ^ other->flags) & MF_FRIENDLY)) + return true;*/ return false; }