From c2e8cc6607ba9af8ec43e6fa7ed76556d1492c16 Mon Sep 17 00:00:00 2001 From: CommonLoon102 <321850+CommonLoon102@users.noreply.github.com> Date: Sun, 22 Sep 2019 16:17:06 +0000 Subject: [PATCH] Do not target teammates (#187) --- source/blood/src/weapon.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/blood/src/weapon.cpp b/source/blood/src/weapon.cpp index f543d319e..7f4e56c38 100644 --- a/source/blood/src/weapon.cpp +++ b/source/blood/src/weapon.cpp @@ -325,6 +325,8 @@ void UpdateAimVector(PLAYER * pPlayer) pSprite = &sprite[nSprite]; if (pSprite == pPSprite) continue; + if (!gGameOptions.bFriendlyFire && IsTargetTeammate(pPlayer, pSprite)) + continue; if (pSprite->hitag&32) continue; if (!(pSprite->hitag&8)) @@ -379,6 +381,8 @@ void UpdateAimVector(PLAYER * pPlayer) for (nSprite = headspritestat[4]; nSprite >= 0; nSprite = nextspritestat[nSprite]) { pSprite = &sprite[nSprite]; + if (!gGameOptions.bFriendlyFire && IsTargetTeammate(pPlayer, pSprite)) + continue; if (!(pSprite->hitag&8)) continue; int x2 = pSprite->x;