Fix weird server crash
This commit is contained in:
+12
-6
@@ -131,6 +131,12 @@ void TransmitManager::Hook_SetTransmit(CCheckTransmitInfo* pInfo, bool bAlways)
|
|||||||
RETURN_META(MRES_IGNORED);
|
RETURN_META(MRES_IGNORED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (g_Hooked[entity] == nullptr)
|
||||||
|
{
|
||||||
|
smutils->LogError(myself, "Why Hooked Entity is nullptr <%d.%s>", entity, gamehelpers->GetEntityClassname(bcref));
|
||||||
|
RETURN_META(MRES_IGNORED);
|
||||||
|
}
|
||||||
|
|
||||||
if (g_Hooked[entity]->ShouldRemove())
|
if (g_Hooked[entity]->ShouldRemove())
|
||||||
{
|
{
|
||||||
auto flags = edict->m_fStateFlags;
|
auto flags = edict->m_fStateFlags;
|
||||||
@@ -168,13 +174,13 @@ void TransmitManager::Hook_SetTransmit(CCheckTransmitInfo* pInfo, bool bAlways)
|
|||||||
bool TransmitManager::SDK_OnLoad(char* error, size_t maxlength, bool late)
|
bool TransmitManager::SDK_OnLoad(char* error, size_t maxlength, bool late)
|
||||||
{
|
{
|
||||||
sharesys->AddDependency(myself, "sdkhooks.ext", true, true);
|
sharesys->AddDependency(myself, "sdkhooks.ext", true, true);
|
||||||
SM_GET_IFACE(SDKHOOKS, g_pSDKHooks)
|
SM_GET_IFACE(SDKHOOKS, g_pSDKHooks);
|
||||||
|
|
||||||
if (!gameconfs->LoadGameConfigFile("sdkhooks.games", &g_pGameConf, error, maxlength))
|
if (!gameconfs->LoadGameConfigFile("sdkhooks.games", &g_pGameConf, error, maxlength))
|
||||||
{
|
{
|
||||||
smutils->Format(error, maxlength, "Failed to load SDKHooks gamedata.");
|
smutils->Format(error, maxlength, "Failed to load SDKHooks gamedata.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto offset = -1;
|
auto offset = -1;
|
||||||
if (!g_pGameConf->GetOffset("SetTransmit", &offset))
|
if (!g_pGameConf->GetOffset("SetTransmit", &offset))
|
||||||
|
|||||||
Reference in New Issue
Block a user