Optimize PlayerBlind (#171)

* Optimize PlayerBlind
This commit is contained in:
In-line 2017-07-06 21:37:44 +04:00 committed by Dmitry Novikov
parent 721624bf92
commit 09e714e339

View File

@ -902,15 +902,15 @@ void EXT_FUNC PlayerBlind(CBasePlayer *pPlayer, entvars_t *pevInflictor, entvars
{
UTIL_ScreenFade(pPlayer, color, fadeTime, fadeHold, alpha, 0);
for (int i = 1; i <= gpGlobals->maxClients; ++i)
if (!fadetoblack.value)
{
CBasePlayer *pObserver = UTIL_PlayerByIndex(i);
if (!pObserver || !pObserver->IsObservingPlayer(pPlayer))
continue;
if (!fadetoblack.value)
for (int i = 1; i <= gpGlobals->maxClients; ++i)
{
UTIL_ScreenFade(pObserver, color, fadeTime, fadeHold, alpha, 0);
CBasePlayer *pObserver = UTIL_PlayerByIndex(i);
if (pObserver && pObserver->IsObservingPlayer(pPlayer))
{
UTIL_ScreenFade(pObserver, color, fadeTime, fadeHold, alpha, 0);
}
}
}