Fix friendly fire damage conditions in multiplayer.

Patch from Striker.

git-svn-id: https://svn.eduke32.com/eduke32@6578 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2018-01-15 17:46:21 +00:00
parent ee298f18b8
commit 8fa438dc0b

View file

@ -1029,10 +1029,21 @@ int A_IncurDamage(int const spriteNum)
int const playerNum = P_GetP(pSprite); int const playerNum = P_GetP(pSprite);
if (pActor->owner >= 0 && ud.ffire == 0 && sprite[pActor->owner].picnum == APLAYER && if (pActor->owner >= 0 && (sprite[pActor->owner].picnum == APLAYER))
(g_gametypeFlags[ud.coop] & GAMETYPE_PLAYERSFRIENDLY || {
(g_gametypeFlags[ud.coop] & GAMETYPE_TDM && g_player[playerNum].ps->team == g_player[P_Get(pActor->owner)].ps->team))) if (
(ud.ffire == 0) &&
(spriteNum != pActor->owner) && // Not damaging self.
((g_gametypeFlags[ud.coop] & GAMETYPE_PLAYERSFRIENDLY) ||
((g_gametypeFlags[ud.coop] & GAMETYPE_TDM) && g_player[playerNum].ps->team == g_player[P_Get(pActor->owner)].ps->team))
)
{
// Nullify damage and cancel.
pActor->owner = -1;
pActor->extra = -1;
return -1; return -1;
}
}
pSprite->extra -= pActor->extra; pSprite->extra -= pActor->extra;