Skip to content

Commit

Permalink
mp_fadetoblack 2: disable fade for observers
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeyShorokhov committed Jul 13, 2023
1 parent 67234cb commit 66c6fb8
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions regamedll/dlls/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2311,7 +2311,7 @@ void EXT_FUNC CBasePlayer::__API_HOOK(Killed)(entvars_t *pevAttacker, int iGib)
}
case 1:
{
UTIL_ScreenFade(this, Vector(0, 0, 0), 0.5f, flDyingDuration, 255, (FFADE_OUT | FFADE_STAYOUT));
UTIL_ScreenFade(this, Vector(0, 0, 0), 0.8f, flDyingDuration, 255, (FFADE_OUT | FFADE_STAYOUT));
break;
}
case 2:
Expand All @@ -2325,15 +2325,7 @@ void EXT_FUNC CBasePlayer::__API_HOOK(Killed)(entvars_t *pevAttacker, int iGib)
MESSAGE_BEGIN(MSG_ONE, gmsgADStop, nullptr, pev);
MESSAGE_END();

for (int i = 1; i <= gpGlobals->maxClients; i++)
{
CBasePlayer* pObserver = UTIL_PlayerByIndex(i);

if (pObserver == this || (pObserver && pObserver->IsObservingPlayer(this)))
{
UTIL_ScreenFade(pObserver, Vector(0, 0, 0), 0.5f, flDyingDuration, 255, (FFADE_OUT));
}
}
UTIL_ScreenFade(this, Vector(0, 0, 0), 0.8f, flDyingDuration, 255, (FFADE_OUT));

break;
}
Expand Down

0 comments on commit 66c6fb8

Please sign in to comment.