From 7ea608068971b986f18f94e47676b649baeb949f Mon Sep 17 00:00:00 2001 From: Daniel Varnai Date: Sat, 3 Nov 2012 14:58:40 -0400 Subject: [PATCH] Fixed SourceTV detection on EP2V, CSS, and CS:GO (bug 5529, r=psychonic). --- core/PlayerManager.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/core/PlayerManager.cpp b/core/PlayerManager.cpp index 1fc4e7e5..9887616e 100644 --- a/core/PlayerManager.cpp +++ b/core/PlayerManager.cpp @@ -574,6 +574,9 @@ void PlayerManager::OnClientPutInServer(edict_t *pEntity, const char *playername // This doesn't actually get incremented until OnClientConnect. Fake it to check. int newCount = m_PlayersSinceActive + 1; int userId = engine->GetPlayerUserId(pEntity); +#if (SOURCE_ENGINE == SE_ORANGEBOXVALVE || SOURCE_ENGINE == SE_CSS) + static ConVar *tv_name = icvar->FindVar("tv_name"); +#endif #if SOURCE_ENGINE == SE_ORANGEBOXVALVE if (m_bIsReplayActive && newCount == 1 @@ -587,7 +590,13 @@ void PlayerManager::OnClientPutInServer(edict_t *pEntity, const char *playername if (m_bIsSourceTVActive && ((!m_bIsReplayActive && newCount == 1) || (m_bIsReplayActive && newCount == 2)) +#if SOURCE_ENGINE == SE_CSGO + && (m_SourceTVUserId == userId || strcmp(playername, "GOTV") == 0) +#elif (SOURCE_ENGINE == SE_ORANGEBOXVALVE || SOURCE_ENGINE == SE_CSS) + && (m_SourceTVUserId == userId || (tv_name && strcmp(playername, tv_name->GetString()) == 0) || (tv_name && tv_name->GetString()[0] == 0 && strcmp(playername, "unnamed") == 0))) +#else && (m_SourceTVUserId == userId || strcmp(playername, "SourceTV") == 0) +#endif ) { pPlayer->m_bIsSourceTV = true;