Fix SDKHooks hook ent validation missing first datatable name (bug 5881, r=asherkin).

This commit is contained in:
Nicholas Hastings
2013-08-24 21:59:52 -04:00
parent 9bf78a96cc
commit 96e971084a
4 changed files with 10 additions and 17 deletions
+6 -12
View File
@@ -64,16 +64,16 @@ CBaseEntity *UTIL_GetCBaseEntity(int num, bool onlyPlayers)
return pUnk->GetBaseEntity();
}
bool UTIL_FindDataTable(SendTable *pTable,
const char *name,
sm_sendprop_info_t *info,
unsigned int offset)
bool UTIL_ContainsDataTable(SendTable *pTable, const char *name)
{
const char *pname;
const char *pname = pTable->GetName();
int props = pTable->GetNumProps();
SendProp *prop;
SendTable *table;
if (pname && strcmp(name, pname) == 0)
return true;
for (int i=0; i<props; i++)
{
prop = pTable->GetProp(i);
@@ -83,16 +83,10 @@ bool UTIL_FindDataTable(SendTable *pTable,
pname = table->GetName();
if (pname && strcmp(name, pname) == 0)
{
info->prop = prop;
info->actual_offset = offset + info->prop->GetOffset();
return true;
}
if (UTIL_FindDataTable(table,
name,
info,
offset + prop->GetOffset())
)
if (UTIL_ContainsDataTable(table, name))
{
return true;
}