From 0b834a3f9b86a357f2db3ce93aad9aa2d1b12f06 Mon Sep 17 00:00:00 2001 From: Borja Ferrer Date: Thu, 8 Dec 2005 20:00:43 +0000 Subject: [PATCH] communicate core when setting a new team or deaths --- dlls/cstrike/cstrike.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/dlls/cstrike/cstrike.cpp b/dlls/cstrike/cstrike.cpp index 7f0491f3..7bfcec1c 100755 --- a/dlls/cstrike/cstrike.cpp +++ b/dlls/cstrike/cstrike.cpp @@ -140,12 +140,8 @@ static cell AMX_NATIVE_CALL cs_set_user_deaths(AMX *amx, cell *params) // cs_set WRITE_SHORT(*((int *)pPlayer->pvPrivateData + OFFSET_TEAM)); // should these be byte? 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); + int *deaths = static_cast(MF_PlayerPropAddr(params[1], Player_Deaths)); + *deaths = params[2]; return 1; } @@ -530,6 +526,13 @@ static cell AMX_NATIVE_CALL cs_set_user_team(AMX *amx, cell *params) // cs_set_u WRITE_BYTE(params[1]); 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); return 1; }