From 8a9b5b7d415dd7c7f19df67b53da97c5a577de68 Mon Sep 17 00:00:00 2001 From: Scott Ehlert Date: Sun, 13 May 2007 07:48:36 +0000 Subject: [PATCH] amb283 - Renamed IsPlayerInGame() to IsClientInGame() --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40790 --- core/smn_player.cpp | 17 +++++++++-------- plugins/include/clients.inc | 11 ++++++++++- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/core/smn_player.cpp b/core/smn_player.cpp index 38e6d34b..fb422ecb 100644 --- a/core/smn_player.cpp +++ b/core/smn_player.cpp @@ -111,7 +111,7 @@ static cell_t sm_GetClientAuthStr(IPluginContext *pCtx, const cell_t *params) return 1; } -static cell_t sm_IsPlayerConnected(IPluginContext *pCtx, const cell_t *params) +static cell_t sm_IsClientConnected(IPluginContext *pCtx, const cell_t *params) { int index = params[1]; if ((index < 1) || (index > g_Players.GetMaxClients())) @@ -122,7 +122,7 @@ static cell_t sm_IsPlayerConnected(IPluginContext *pCtx, const cell_t *params) return (g_Players.GetPlayerByIndex(index)->IsConnected()) ? 1 : 0; } -static cell_t sm_IsPlayerIngame(IPluginContext *pCtx, const cell_t *params) +static cell_t sm_IsClientInGame(IPluginContext *pCtx, const cell_t *params) { int index = params[1]; if ((index < 1) || (index > g_Players.GetMaxClients())) @@ -133,7 +133,7 @@ static cell_t sm_IsPlayerIngame(IPluginContext *pCtx, const cell_t *params) return (g_Players.GetPlayerByIndex(index)->IsInGame()) ? 1 : 0; } -static cell_t sm_IsPlayerAuthorized(IPluginContext *pCtx, const cell_t *params) +static cell_t sm_IsClientAuthorized(IPluginContext *pCtx, const cell_t *params) { int index = params[1]; if ((index < 1) || (index > g_Players.GetMaxClients())) @@ -144,7 +144,7 @@ static cell_t sm_IsPlayerAuthorized(IPluginContext *pCtx, const cell_t *params) return (g_Players.GetPlayerByIndex(index)->IsAuthorized()) ? 1 : 0; } -static cell_t sm_IsPlayerFakeClient(IPluginContext *pCtx, const cell_t *params) +static cell_t sm_IsClientFakeClient(IPluginContext *pCtx, const cell_t *params) { int index = params[1]; if ((index < 1) || (index > g_Players.GetMaxClients())) @@ -830,10 +830,11 @@ REGISTER_NATIVES(playernatives) {"GetMaxClients", sm_GetMaxClients}, {"GetUserAdmin", GetUserAdmin}, {"GetUserFlagBits", GetUserFlagBits}, - {"IsClientAuthorized", sm_IsPlayerAuthorized}, - {"IsClientConnected", sm_IsPlayerConnected}, - {"IsFakeClient", sm_IsPlayerFakeClient}, - {"IsPlayerInGame", sm_IsPlayerIngame}, + {"IsClientAuthorized", sm_IsClientAuthorized}, + {"IsClientConnected", sm_IsClientConnected}, + {"IsFakeClient", sm_IsClientFakeClient}, + {"IsPlayerInGame", sm_IsClientInGame}, /* Backwards compat shim */ + {"IsClientInGame", sm_IsClientInGame}, {"RemoveUserFlags", RemoveUserFlags}, {"SetUserAdmin", SetUserAdmin}, {"SetUserFlagBits", SetUserFlagBits}, diff --git a/plugins/include/clients.inc b/plugins/include/clients.inc index a01280a6..66e8c298 100644 --- a/plugins/include/clients.inc +++ b/plugins/include/clients.inc @@ -158,7 +158,16 @@ native bool:IsClientConnected(client); * @param client Player index. * @return True if player has entered the game, false otherwise. */ -native bool:IsPlayerInGame(client); +native bool:IsClientInGame(client); + +/** + * Backwards compatibility stock - use IsClientInGame + * @deprecated Renamed to IsClientInGame + */ +stock bool:IsPlayerInGame(client) +{ + return IsClientInGame(client); +} /** * Returns if a certain player has been authenticated.