Skip to content

Commit

Permalink
Attribute infighting kills to a player in netgames
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkd committed Nov 18, 2021
1 parent c6e8334 commit 3e3fe6b
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions src/doom/p_inter.c
Original file line number Diff line number Diff line change
Expand Up @@ -742,11 +742,29 @@ P_KillMobj
if (target->player)
source->player->frags[target->player-players]++;
}
else if (!netgame && (target->flags & MF_COUNTKILL) )
else if (target->flags & MF_COUNTKILL)
{
// count all monster deaths,
// even those caused by other monsters
players[0].killcount++;
if (!netgame)
{
players[0].killcount++;
}
else // netgame
{
if (!deathmatch)
{
// add kill to first player who is still ingame
for (unsigned int plridx = 0; plridx < MAXPLAYERS; plridx++)
{
if (playeringame[plridx])
{
players[plridx].killcount++;
break;
}
}
}
}
}

if (target->player)
Expand Down

0 comments on commit 3e3fe6b

Please sign in to comment.