From db76fc7b66357c3a0575f7cd75b3703a487f0df6 Mon Sep 17 00:00:00 2001 From: Arkshine Date: Mon, 12 May 2014 14:41:08 +0200 Subject: [PATCH] Fix cs_set_user_team issue on spectator --- dlls/cstrike/cstrike/cstrike.cpp | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/dlls/cstrike/cstrike/cstrike.cpp b/dlls/cstrike/cstrike/cstrike.cpp index b767622d..4e9b41ac 100755 --- a/dlls/cstrike/cstrike/cstrike.cpp +++ b/dlls/cstrike/cstrike/cstrike.cpp @@ -589,12 +589,21 @@ static cell AMX_NATIVE_CALL cs_set_user_team(AMX *amx, cell *params) // cs_set_u WRITE_STRING(teaminfo); MESSAGE_END(); - if (params[2] == 1) - MF_SetPlayerTeamInfo(params[1], params[2], "TERRORIST"); - else if (params[2] == 2) - MF_SetPlayerTeamInfo(params[1], params[2], "CT"); - else - MF_SetPlayerTeamInfo(params[1], params[2], NULL); + switch (params[2]) + { + case TEAM_T: + MF_SetPlayerTeamInfo(params[1], params[2], "TERRORIST"); + break; + case TEAM_CT: + MF_SetPlayerTeamInfo(params[1], params[2], "CT"); + break; + case TEAM_SPECTATOR: + MF_SetPlayerTeamInfo(params[1], params[2], "SPECTATOR"); + break; + default: + MF_SetPlayerTeamInfo(params[1], params[2], NULL); + break; + } return 1; }