fixed amb1586 for real
--HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402052
This commit is contained in:
parent
2fbd32cd1a
commit
6d2a3a7964
@ -42,6 +42,11 @@ SourceHook::CVector<TeamInfo> g_Teams;
|
|||||||
|
|
||||||
bool FindTeamEntities(SendTable *pTable, const char *name)
|
bool FindTeamEntities(SendTable *pTable, const char *name)
|
||||||
{
|
{
|
||||||
|
if (strcmp(pTable->GetName(), name) == 0)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
int props = pTable->GetNumProps();
|
int props = pTable->GetNumProps();
|
||||||
SendProp *prop;
|
SendProp *prop;
|
||||||
|
|
||||||
@ -50,10 +55,6 @@ bool FindTeamEntities(SendTable *pTable, const char *name)
|
|||||||
prop = pTable->GetProp(i);
|
prop = pTable->GetProp(i);
|
||||||
if (prop->GetDataTable())
|
if (prop->GetDataTable())
|
||||||
{
|
{
|
||||||
if (strcmp(prop->GetDataTable()->GetName(), name) == 0)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (FindTeamEntities(prop->GetDataTable(), name))
|
if (FindTeamEntities(prop->GetDataTable(), name))
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
@ -111,7 +112,7 @@ static cell_t GetTeamCount(IPluginContext *pContext, const cell_t *params)
|
|||||||
static cell_t GetTeamName(IPluginContext *pContext, const cell_t *params)
|
static cell_t GetTeamName(IPluginContext *pContext, const cell_t *params)
|
||||||
{
|
{
|
||||||
int teamindex = params[1];
|
int teamindex = params[1];
|
||||||
if (teamindex > (int)g_Teams.size())
|
if (!g_Teams[teamindex].ClassName || (teamindex > (int)g_Teams.size()))
|
||||||
{
|
{
|
||||||
pContext->ThrowNativeError("Team index %d is invalid", teamindex);
|
pContext->ThrowNativeError("Team index %d is invalid", teamindex);
|
||||||
}
|
}
|
||||||
@ -127,7 +128,7 @@ static cell_t GetTeamName(IPluginContext *pContext, const cell_t *params)
|
|||||||
static cell_t GetTeamScore(IPluginContext *pContext, const cell_t *params)
|
static cell_t GetTeamScore(IPluginContext *pContext, const cell_t *params)
|
||||||
{
|
{
|
||||||
int teamindex = params[1];
|
int teamindex = params[1];
|
||||||
if (teamindex > (int)g_Teams.size())
|
if (!g_Teams[teamindex].ClassName || (teamindex > (int)g_Teams.size()))
|
||||||
{
|
{
|
||||||
pContext->ThrowNativeError("Team index %d is invalid", teamindex);
|
pContext->ThrowNativeError("Team index %d is invalid", teamindex);
|
||||||
}
|
}
|
||||||
@ -140,7 +141,7 @@ static cell_t GetTeamScore(IPluginContext *pContext, const cell_t *params)
|
|||||||
static cell_t SetTeamScore(IPluginContext *pContext, const cell_t *params)
|
static cell_t SetTeamScore(IPluginContext *pContext, const cell_t *params)
|
||||||
{
|
{
|
||||||
int teamindex = params[1];
|
int teamindex = params[1];
|
||||||
if (teamindex > (int)g_Teams.size())
|
if (!g_Teams[teamindex].ClassName || (teamindex > (int)g_Teams.size()))
|
||||||
{
|
{
|
||||||
pContext->ThrowNativeError("Team index %d is invalid", teamindex);
|
pContext->ThrowNativeError("Team index %d is invalid", teamindex);
|
||||||
}
|
}
|
||||||
@ -154,7 +155,7 @@ static cell_t SetTeamScore(IPluginContext *pContext, const cell_t *params)
|
|||||||
static cell_t GetTeamClientCount(IPluginContext *pContext, const cell_t *params)
|
static cell_t GetTeamClientCount(IPluginContext *pContext, const cell_t *params)
|
||||||
{
|
{
|
||||||
int teamindex = params[1];
|
int teamindex = params[1];
|
||||||
if (teamindex > (int)g_Teams.size())
|
if (!g_Teams[teamindex].ClassName || (teamindex > (int)g_Teams.size()))
|
||||||
{
|
{
|
||||||
pContext->ThrowNativeError("Team index %d is invalid", teamindex);
|
pContext->ThrowNativeError("Team index %d is invalid", teamindex);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user