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
+2 -2
View File
@@ -190,13 +190,13 @@ cell_t Native_DropWeapon(IPluginContext *pContext, const cell_t *params)
if (!pWeapon)
return pContext->ThrowNativeError("Invalid entity index %d for weapon", params[2]);
sm_sendprop_info_t spi;
IServerUnknown *pUnk = (IServerUnknown *)pWeapon;
IServerNetworkable *pNet = pUnk->GetNetworkable();
if (!UTIL_FindDataTable(pNet->GetServerClass()->m_pTable, "DT_BaseCombatWeapon", &spi, 0))
if (!UTIL_ContainsDataTable(pNet->GetServerClass()->m_pTable, "DT_BaseCombatWeapon"))
return pContext->ThrowNativeError("Entity index %d is not a weapon", params[2]);
sm_sendprop_info_t spi;
if (!gamehelpers->FindSendPropInfo("CBaseCombatWeapon", "m_hOwnerEntity", &spi))
return pContext->ThrowNativeError("Invalid entity index %d for weapon", params[2]);