From 9ad3aa29f3cebb20ee8673426c08c1f7f3c822aa Mon Sep 17 00:00:00 2001 From: nosoop Date: Wed, 21 Nov 2018 22:15:12 -0800 Subject: [PATCH] Forgot to deduplicate client bot index --- natives.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/natives.cpp b/natives.cpp index f4db463..f53e61a 100644 --- a/natives.cpp +++ b/natives.cpp @@ -828,18 +828,18 @@ static cell_t Native_PrintToChat(IPluginContext *pContext, const cell_t *params) #if SOURCE_ENGINE != SE_CSGO // There's no way to set the current translation without a client index, so we'll save / restore the language on the relay. - int iHLTVClient = hltvserver->GetHLTVServer()->GetHLTVSlot() + 1; - IGamePlayer *pHLTVClient = playerhelpers->GetGamePlayer(iHLTVClient); - pHLTVClient->SetLanguageId(pClient->GetLanguageId()); + int iHLTVRelay = hltvserver->GetHLTVServer()->GetHLTVSlot() + 1; + IGamePlayer *pHLTVRelay = playerhelpers->GetGamePlayer(iHLTVRelay); + pHLTVRelay->SetLanguageId(pClient->GetLanguageId()); - int restoreTarget = translator->SetGlobalTarget(hltvserver->GetHLTVServer()->GetHLTVSlot() + 1); + int restoreTarget = translator->SetGlobalTarget(iHLTVRelay); #endif DetectExceptions eh(pContext); len = smutils->FormatString(buffer, sizeof(buffer), pContext, params, 2); #if SOURCE_ENGINE != SE_CSGO - pHLTVClient->SetLanguageId(translator->GetServerLanguage()); + pHLTVRelay->SetLanguageId(translator->GetServerLanguage()); translator->SetGlobalTarget(restoreTarget); #endif @@ -898,18 +898,18 @@ static cell_t Native_PrintToConsole(IPluginContext *pContext, const cell_t *para #if SOURCE_ENGINE != SE_CSGO // There's no way to set the current translation without a client index, so we'll save / restore the language on the relay. - int iHLTVClient = hltvserver->GetHLTVServer()->GetHLTVSlot() + 1; - IGamePlayer *pHLTVClient = playerhelpers->GetGamePlayer(iHLTVClient); - pHLTVClient->SetLanguageId(pClient->GetLanguageId()); + int iHLTVRelay = hltvserver->GetHLTVServer()->GetHLTVSlot() + 1; + IGamePlayer *pHLTVRelay = playerhelpers->GetGamePlayer(iHLTVRelay); + pHLTVRelay->SetLanguageId(pClient->GetLanguageId()); - int restoreTarget = translator->SetGlobalTarget(hltvserver->GetHLTVServer()->GetHLTVSlot() + 1); + int restoreTarget = translator->SetGlobalTarget(iHLTVRelay); #endif DetectExceptions eh(pContext); len = smutils->FormatString(buffer, sizeof(buffer), pContext, params, 2); #if SOURCE_ENGINE != SE_CSGO - pHLTVClient->SetLanguageId(translator->GetServerLanguage()); + pHLTVRelay->SetLanguageId(translator->GetServerLanguage()); translator->SetGlobalTarget(restoreTarget); #endif