Reconcile the concept of Edict & Networkable across the codebase (#1903)
* Reconcile the concept of Edict & Networkable across the codebase * There's no need to check this, it's done elsewhere. Also could be null (segfault) * This was never needed * Pseudo review changes Re-added removed null checks, and added new ones. Changed the error messages in Get/SetProp natives to better reflect reality. * Don't change the behaviour of GetEntityNetClass * Overload IGameHelpers::FindServerClass * Make error messages more accurate * Fix a dev comment * Rename FindServerClass --------- Co-authored-by: Kenzzer <[email protected]>
This commit is contained in:
@@ -614,11 +614,16 @@ HookReturn SDKHooks::Hook(int entity, SDKHookType type, IPluginFunction *callbac
|
||||
|
||||
if (!!strcmp(g_HookTypes[type].dtReq, ""))
|
||||
{
|
||||
IServerUnknown *pUnk = (IServerUnknown *)pEnt;
|
||||
|
||||
IServerNetworkable *pNet = pUnk->GetNetworkable();
|
||||
if (pNet && !UTIL_ContainsDataTable(pNet->GetServerClass()->m_pTable, g_HookTypes[type].dtReq))
|
||||
ServerClass *pServerClass = gamehelpers->FindEntityServerClass(pEnt);
|
||||
if (pServerClass == nullptr)
|
||||
{
|
||||
return HookRet_BadEntForHookType;
|
||||
}
|
||||
|
||||
if (!UTIL_ContainsDataTable(pServerClass->m_pTable, g_HookTypes[type].dtReq))
|
||||
{
|
||||
return HookRet_BadEntForHookType;
|
||||
}
|
||||
}
|
||||
|
||||
size_t entry;
|
||||
|
||||
Reference in New Issue
Block a user