fixed amb1586 for real

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402052
This commit is contained in:
Borja Ferrer 2008-04-12 23:03:30 +00:00
parent 2fbd32cd1a
commit 6d2a3a7964

View File

@ -42,6 +42,11 @@ SourceHook::CVector<TeamInfo> g_Teams;
bool FindTeamEntities(SendTable *pTable, const char *name)
{
if (strcmp(pTable->GetName(), name) == 0)
{
return true;
}
int props = pTable->GetNumProps();
SendProp *prop;
@ -50,10 +55,6 @@ bool FindTeamEntities(SendTable *pTable, const char *name)
prop = pTable->GetProp(i);
if (prop->GetDataTable())
{
if (strcmp(prop->GetDataTable()->GetName(), name) == 0)
{
return true;
}
if (FindTeamEntities(prop->GetDataTable(), name))
{
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)
{
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);
}
@ -127,7 +128,7 @@ static cell_t GetTeamName(IPluginContext *pContext, const cell_t *params)
static cell_t GetTeamScore(IPluginContext *pContext, const cell_t *params)
{
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);
}
@ -140,7 +141,7 @@ static cell_t GetTeamScore(IPluginContext *pContext, const cell_t *params)
static cell_t SetTeamScore(IPluginContext *pContext, const cell_t *params)
{
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);
}
@ -154,7 +155,7 @@ static cell_t SetTeamScore(IPluginContext *pContext, const cell_t *params)
static cell_t GetTeamClientCount(IPluginContext *pContext, const cell_t *params)
{
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);
}