SM Central fixes for new language natives (bug 4613).

This commit is contained in:
Nicholas Hastings 2011-03-12 23:56:04 -05:00
parent a81567e2d6
commit 46804d0faf
4 changed files with 11 additions and 3 deletions

View File

@ -1777,6 +1777,11 @@ unsigned int CPlayer::GetLanguageId()
return m_LangId; return m_LangId;
} }
void CPlayer::SetLanguageId(unsigned int id)
{
m_LangId = id;
}
int CPlayer::GetUserId() int CPlayer::GetUserId()
{ {
if (m_UserId == -1) if (m_UserId == -1)

View File

@ -82,6 +82,7 @@ public:
bool IsInKickQueue(); bool IsInKickQueue();
IPlayerInfo *GetPlayerInfo(); IPlayerInfo *GetPlayerInfo();
unsigned int GetLanguageId(); unsigned int GetLanguageId();
void SetLanguageId(unsigned int id);
int GetUserId(); int GetUserId();
bool RunAdminCacheChecks(); bool RunAdminCacheChecks();
void NotifyPostAdminChecks(); void NotifyPostAdminChecks();

View File

@ -106,14 +106,14 @@ static cell_t sm_GetLanguageInfo(IPluginContext *pContext, const cell_t *params)
static cell_t sm_SetClientLanguage(IPluginContext *pContext, const cell_t *params) static cell_t sm_SetClientLanguage(IPluginContext *pContext, const cell_t *params)
{ {
CPlayer *player = g_Players.GetPlayerByIndex(params[1]); IGamePlayer *player = playerhelpers->GetGamePlayer(params[1]);
if (!player || !player->IsInGame()) if (!player || !player->IsInGame())
{ {
return pContext->ThrowNativeError("Invalid client index %d", params[1]); return pContext->ThrowNativeError("Invalid client index %d", params[1]);
} }
player->m_LangId = params[2]; player->SetLanguageId(params[2]);
return 1; return 1;
} }

View File

@ -41,7 +41,7 @@
#include <IAdminSystem.h> #include <IAdminSystem.h>
#define SMINTERFACE_PLAYERMANAGER_NAME "IPlayerManager" #define SMINTERFACE_PLAYERMANAGER_NAME "IPlayerManager"
#define SMINTERFACE_PLAYERMANAGER_VERSION 13 #define SMINTERFACE_PLAYERMANAGER_VERSION 14
struct edict_t; struct edict_t;
class IPlayerInfo; class IPlayerInfo;
@ -220,6 +220,8 @@ namespace SourceMod
* to actually add them to the queue. * to actually add them to the queue.
*/ */
virtual void MarkAsBeingKicked() =0; virtual void MarkAsBeingKicked() =0;
virtual void SetLanguageId(unsigned int id) =0;
}; };
/** /**