mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2025-01-28 22:48:02 +03:00
Observer_IsValidTarget: checks refactoring
This commit is contained in:
parent
a9111f8dda
commit
a390cadcd0
@ -29,7 +29,19 @@ CBasePlayer *CBasePlayer::__API_HOOK(Observer_IsValidTarget)(int iPlayerIndex, b
|
|||||||
CBasePlayer *pPlayer = UTIL_PlayerByIndex(iPlayerIndex);
|
CBasePlayer *pPlayer = UTIL_PlayerByIndex(iPlayerIndex);
|
||||||
|
|
||||||
// Don't spec observers or players who haven't picked a class yet
|
// Don't spec observers or players who haven't picked a class yet
|
||||||
if (!pPlayer || pPlayer == this || pPlayer->has_disconnected || pPlayer->GetObserverMode() != OBS_NONE || (pPlayer->pev->effects & EF_NODRAW) || pPlayer->m_iTeam == UNASSIGNED || (bSameTeam && pPlayer->m_iTeam != m_iTeam))
|
if (!pPlayer || pPlayer == this)
|
||||||
|
return nullptr;
|
||||||
|
|
||||||
|
if (pPlayer->has_disconnected)
|
||||||
|
return nullptr;
|
||||||
|
|
||||||
|
if (pPlayer->GetObserverMode() != OBS_NONE)
|
||||||
|
return nullptr;
|
||||||
|
|
||||||
|
if (pPlayer->pev->effects & EF_NODRAW)
|
||||||
|
return nullptr;
|
||||||
|
|
||||||
|
if (pPlayer->m_iTeam == UNASSIGNED || (bSameTeam && pPlayer->m_iTeam != m_iTeam))
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
return pPlayer;
|
return pPlayer;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user