Spectate: Only alter spectate modes on CSS.

CSGO doesnt have any broken spectate modes.
This commit is contained in:
zaCade 2019-03-11 02:19:31 +01:00
parent c28af04bbd
commit 2fad81dc0e

View File

@ -51,17 +51,20 @@ public void OnMapStart()
public void OnClientSettingsChanged(int client) public void OnClientSettingsChanged(int client)
{ {
static char sSpecMode[8]; if(GetEngineVersion() == Engine_CSS)
GetClientInfo(client, "cl_spec_mode", sSpecMode, sizeof(sSpecMode));
Obs_Mode iObserverMode = view_as<Obs_Mode>(StringToInt(sSpecMode));
// Skip broken OBS_MODE_POI
if (iObserverMode == OBS_MODE_POI)
{ {
ClientCommand(client, "cl_spec_mode %d", OBS_MODE_ROAMING); static char sSpecMode[8];
if(IsClientInGame(client) && !IsPlayerAlive(client)) GetClientInfo(client, "cl_spec_mode", sSpecMode, sizeof(sSpecMode));
SetEntProp(client, Prop_Send, "m_iObserverMode", OBS_MODE_ROAMING);
Obs_Mode iObserverMode = view_as<Obs_Mode>(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);
}
} }
} }