From 2fad81dc0e1dbbbb0b1f9afad87471897bdfe14c Mon Sep 17 00:00:00 2001 From: zaCade Date: Mon, 11 Mar 2019 02:19:31 +0100 Subject: [PATCH] Spectate: Only alter spectate modes on CSS. CSGO doesnt have any broken spectate modes. --- .../Spectate/scripting/Spectate.sp | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/_CleanupRequired/Spectate/scripting/Spectate.sp b/_CleanupRequired/Spectate/scripting/Spectate.sp index c43ec690..2da68e82 100644 --- a/_CleanupRequired/Spectate/scripting/Spectate.sp +++ b/_CleanupRequired/Spectate/scripting/Spectate.sp @@ -51,17 +51,20 @@ public void OnMapStart() public void OnClientSettingsChanged(int client) { - static char sSpecMode[8]; - GetClientInfo(client, "cl_spec_mode", sSpecMode, sizeof(sSpecMode)); - - Obs_Mode iObserverMode = view_as(StringToInt(sSpecMode)); - - // Skip broken OBS_MODE_POI - if (iObserverMode == OBS_MODE_POI) + if(GetEngineVersion() == Engine_CSS) { - ClientCommand(client, "cl_spec_mode %d", OBS_MODE_ROAMING); - if(IsClientInGame(client) && !IsPlayerAlive(client)) - SetEntProp(client, Prop_Send, "m_iObserverMode", OBS_MODE_ROAMING); + static char sSpecMode[8]; + GetClientInfo(client, "cl_spec_mode", sSpecMode, sizeof(sSpecMode)); + + Obs_Mode iObserverMode = view_as(StringToInt(sSpecMode)); + + // Skip broken OBS_MODE_POI + if (iObserverMode == OBS_MODE_POI) + { + ClientCommand(client, "cl_spec_mode %d", OBS_MODE_ROAMING); + if(IsClientInGame(client) && !IsPlayerAlive(client)) + SetEntProp(client, Prop_Send, "m_iObserverMode", OBS_MODE_ROAMING); + } } }