mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-12 11:10:39 +00:00
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:
parent
ee298f18b8
commit
8fa438dc0b
1 changed files with 15 additions and 4 deletions
|
@ -1029,10 +1029,21 @@ int A_IncurDamage(int const spriteNum)
|
|||
|
||||
int const playerNum = P_GetP(pSprite);
|
||||
|
||||
if (pActor->owner >= 0 && ud.ffire == 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 (pActor->owner >= 0 && (sprite[pActor->owner].picnum == APLAYER))
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
pSprite->extra -= pActor->extra;
|
||||
|
||||
|
|
Loading…
Reference in a new issue