Fixed possible sync issue with frag counts

This commit is contained in:
Edward Richardson 2015-08-30 23:36:00 +12:00
parent b87435ac9d
commit 02c562518d

View file

@ -268,8 +268,6 @@ void ClientObituary (AActor *self, AActor *inflictor, AActor *attacker, int dmgf
{ {
if (friendly) if (friendly)
{ {
attacker->player->fragcount -= 2;
attacker->player->frags[attacker->player - players]++;
self = attacker; self = attacker;
gender = self->player->userinfo.GetGender(); gender = self->player->userinfo.GetGender();
mysnprintf (gendermessage, countof(gendermessage), "OB_FRIENDLY%c", '1' + (pr_obituary() & 3)); mysnprintf (gendermessage, countof(gendermessage), "OB_FRIENDLY%c", '1' + (pr_obituary() & 3));
@ -467,12 +465,21 @@ void AActor::Die (AActor *source, AActor *inflictor, int dmgflags)
if ((dmflags2 & DF2_YES_LOSEFRAG) && deathmatch) if ((dmflags2 & DF2_YES_LOSEFRAG) && deathmatch)
player->fragcount--; player->fragcount--;
++source->player->fragcount; if (this->IsTeammate(source))
++source->player->spreecount; {
source->player->fragcount--;
}
else
{
++source->player->fragcount;
++source->player->spreecount;
}
if (source->player->morphTics) if (source->player->morphTics)
{ // Make a super chicken { // Make a super chicken
source->GiveInventoryType (RUNTIME_CLASS(APowerWeaponLevel2)); source->GiveInventoryType (RUNTIME_CLASS(APowerWeaponLevel2));
} }
if (deathmatch && cl_showsprees) if (deathmatch && cl_showsprees)
{ {
const char *spreemsg; const char *spreemsg;