Rename smcore to bridge, and use it as a pointer.

This commit is contained in:
David Anderson
2015-08-30 23:27:53 -07:00
parent a2dac43833
commit 3d5c9f0e21
19 changed files with 130 additions and 127 deletions
+20 -20
View File
@@ -281,13 +281,13 @@ static cell_t sm_GetClientName(IPluginContext *pCtx, const cell_t *params)
static ConVar *hostname = NULL;
if (!hostname)
{
hostname = smcore.FindConVar("hostname");
hostname = bridge->FindConVar("hostname");
if (!hostname)
{
return pCtx->ThrowNativeError("Could not find \"hostname\" cvar");
}
}
pCtx->StringToLocalUTF8(params[2], static_cast<size_t>(params[3]), smcore.GetCvarString(hostname), NULL);
pCtx->StringToLocalUTF8(params[2], static_cast<size_t>(params[3]), bridge->GetCvarString(hostname), NULL);
return 1;
}
@@ -763,7 +763,7 @@ static cell_t IsClientObserver(IPluginContext *pContext, const cell_t *params)
return pContext->ThrowNativeError("IPlayerInfo not supported by game");
}
return smcore.playerInfo->IsObserver(pInfo) ? 1 : 0;
return bridge->playerInfo->IsObserver(pInfo) ? 1 : 0;
}
static cell_t GetClientTeam(IPluginContext *pContext, const cell_t *params)
@@ -785,7 +785,7 @@ static cell_t GetClientTeam(IPluginContext *pContext, const cell_t *params)
return pContext->ThrowNativeError("IPlayerInfo not supported by game");
}
return smcore.playerInfo->GetTeamIndex(pInfo);
return bridge->playerInfo->GetTeamIndex(pInfo);
}
static cell_t GetFragCount(IPluginContext *pContext, const cell_t *params)
@@ -807,7 +807,7 @@ static cell_t GetFragCount(IPluginContext *pContext, const cell_t *params)
return pContext->ThrowNativeError("IPlayerInfo not supported by game");
}
return smcore.playerInfo->GetFragCount(pInfo);
return bridge->playerInfo->GetFragCount(pInfo);
}
static cell_t GetDeathCount(IPluginContext *pContext, const cell_t *params)
@@ -829,7 +829,7 @@ static cell_t GetDeathCount(IPluginContext *pContext, const cell_t *params)
return pContext->ThrowNativeError("IPlayerInfo not supported by game");
}
return smcore.playerInfo->GetDeathCount(pInfo);
return bridge->playerInfo->GetDeathCount(pInfo);
}
static cell_t GetArmorValue(IPluginContext *pContext, const cell_t *params)
@@ -851,7 +851,7 @@ static cell_t GetArmorValue(IPluginContext *pContext, const cell_t *params)
return pContext->ThrowNativeError("IPlayerInfo not supported by game");
}
return smcore.playerInfo->GetArmorValue(pInfo);
return bridge->playerInfo->GetArmorValue(pInfo);
}
static cell_t GetAbsOrigin(IPluginContext *pContext, const cell_t *params)
@@ -877,7 +877,7 @@ static cell_t GetAbsOrigin(IPluginContext *pContext, const cell_t *params)
pContext->LocalToPhysAddr(params[2], &pVec);
float x, y, z;
smcore.playerInfo->GetAbsOrigin(pInfo, &x, &y, &z);
bridge->playerInfo->GetAbsOrigin(pInfo, &x, &y, &z);
pVec[0] = sp_ftoc(x);
pVec[1] = sp_ftoc(y);
pVec[2] = sp_ftoc(z);
@@ -908,7 +908,7 @@ static cell_t GetAbsAngles(IPluginContext *pContext, const cell_t *params)
pContext->LocalToPhysAddr(params[2], &pAng);
float x, y, z;
smcore.playerInfo->GetAbsAngles(pInfo, &x, &y, &z);
bridge->playerInfo->GetAbsAngles(pInfo, &x, &y, &z);
pAng[0] = sp_ftoc(x);
pAng[1] = sp_ftoc(y);
pAng[2] = sp_ftoc(z);
@@ -939,7 +939,7 @@ static cell_t GetPlayerMins(IPluginContext *pContext, const cell_t *params)
pContext->LocalToPhysAddr(params[2], &pVec);
float x, y, z;
smcore.playerInfo->GetPlayerMins(pInfo, &x, &y, &z);
bridge->playerInfo->GetPlayerMins(pInfo, &x, &y, &z);
pVec[0] = sp_ftoc(x);
pVec[1] = sp_ftoc(y);
pVec[2] = sp_ftoc(z);
@@ -970,7 +970,7 @@ static cell_t GetPlayerMaxs(IPluginContext *pContext, const cell_t *params)
pContext->LocalToPhysAddr(params[2], &pVec);
float x, y, z;
smcore.playerInfo->GetPlayerMaxs(pInfo, &x, &y, &z);
bridge->playerInfo->GetPlayerMaxs(pInfo, &x, &y, &z);
pVec[0] = sp_ftoc(x);
pVec[1] = sp_ftoc(y);
pVec[2] = sp_ftoc(z);
@@ -997,7 +997,7 @@ static cell_t GetWeaponName(IPluginContext *pContext, const cell_t *params)
return pContext->ThrowNativeError("IPlayerInfo not supported by game");
}
const char *weapon = smcore.playerInfo->GetWeaponName(pInfo);
const char *weapon = bridge->playerInfo->GetWeaponName(pInfo);
pContext->StringToLocalUTF8(params[2], static_cast<size_t>(params[3]), weapon ? weapon : "", NULL);
return 1;
@@ -1022,7 +1022,7 @@ static cell_t GetModelName(IPluginContext *pContext, const cell_t *params)
return pContext->ThrowNativeError("IPlayerInfo not supported by game");
}
const char *model = smcore.playerInfo->GetModelName(pInfo);
const char *model = bridge->playerInfo->GetModelName(pInfo);
pContext->StringToLocalUTF8(params[2], static_cast<size_t>(params[3]), model ? model : "", NULL);
return 1;
@@ -1047,7 +1047,7 @@ static cell_t GetHealth(IPluginContext *pContext, const cell_t *params)
return pContext->ThrowNativeError("IPlayerInfo not supported by game");
}
return smcore.playerInfo->GetHealth(pInfo);
return bridge->playerInfo->GetHealth(pInfo);
}
static cell_t GetClientOfUserId(IPluginContext *pContext, const cell_t *params)
@@ -1062,7 +1062,7 @@ static cell_t _ShowActivity(IPluginContext *pContext,
{
char message[255];
char buffer[255];
int value = smcore.GetActivityFlags();
int value = bridge->GetActivityFlags();
unsigned int replyto = playerhelpers->GetReplyTo();
int client = params[1];
@@ -1113,7 +1113,7 @@ static cell_t _ShowActivity(IPluginContext *pContext,
}
g_pSM->Format(message, sizeof(message), "%s%s\n", tag, buffer);
smcore.ConPrint(message);
bridge->ConPrint(message);
}
if (value == kActivityNone)
@@ -1193,7 +1193,7 @@ static cell_t _ShowActivity2(IPluginContext *pContext,
{
char message[255];
char buffer[255];
int value = smcore.GetActivityFlags();
int value = bridge->GetActivityFlags();
unsigned int replyto = playerhelpers->GetReplyTo();
int client = params[1];
@@ -1240,7 +1240,7 @@ static cell_t _ShowActivity2(IPluginContext *pContext,
}
g_pSM->Format(message, sizeof(message), "%s%s\n", tag, buffer);
smcore.ConPrint(message);
bridge->ConPrint(message);
}
if (value == kActivityNone)
@@ -1426,7 +1426,7 @@ static cell_t ChangeClientTeam(IPluginContext *pContext, const cell_t *params)
return pContext->ThrowNativeError("IPlayerInfo not supported by game");
}
smcore.playerInfo->ChangeTeam(pInfo, params[2]);
bridge->playerInfo->ChangeTeam(pInfo, params[2]);
return 1;
}
@@ -1528,7 +1528,7 @@ static cell_t FormatActivitySource(IPluginContext *pContext, const cell_t *param
return pContext->ThrowNativeError("Client %d not connected", target);
}
value = smcore.GetActivityFlags();
value = bridge->GetActivityFlags();
if (client != 0)
{