Fixed SetTeamScore not updating score on client (bug 2736, r=fyren).

This commit is contained in:
Nicholas Hastings 2011-02-28 19:40:21 -05:00
parent f27685717b
commit c3a98db0ea

View File

@ -171,7 +171,12 @@ static cell_t SetTeamScore(IPluginContext *pContext, const cell_t *params)
}
static int offset = g_pGameHelpers->FindInSendTable(g_Teams[teamindex].ClassName, "m_iScore")->GetOffset();
*(int *)((unsigned char *)g_Teams[teamindex].pEnt + offset) = params[2];
CBaseEntity *pTeam = g_Teams[teamindex].pEnt;
*(int *)((unsigned char *)pTeam + offset) = params[2];
edict_t *pEdict = gameents->BaseEntityToEdict(pTeam);
gamehelpers->SetEdictStateChanged(pEdict, offset);
return 1;
}