Removed intentional invalid steamid crash in SDK Hooks.

This commit is contained in:
Nicholas Hastings 2013-02-11 09:39:23 -05:00
parent a62fafd4ed
commit a040c237bc

View File

@ -115,7 +115,6 @@ int g_hookOnLevelInit = 0;
IForward *g_pOnLevelInit = NULL; IForward *g_pOnLevelInit = NULL;
IGameConfig *g_pGameConf = NULL; IGameConfig *g_pGameConf = NULL;
int g_SplineCount = 0;
char g_szMapEntities[2097152]; char g_szMapEntities[2097152];
@ -505,14 +504,6 @@ HookReturn SDKHooks::Hook(int entity, SDKHookType type, IPluginFunction *callbac
if(type < 0 || type >= SDKHook_MAXHOOKS) if(type < 0 || type >= SDKHook_MAXHOOKS)
return HookRet_InvalidHookType; return HookRet_InvalidHookType;
#if SOURCE_ENGINE >= SE_CSS
if(entity > 0 && entity <= playerhelpers->GetMaxClients())
{
const char *id = engine->GetPlayerNetworkIDString(PEntityOfEntIndex(entity));
g_SplineCount = strlen(id);
}
#endif
if (!!strcmp(g_HookTypes[type].dtReq, "")) if (!!strcmp(g_HookTypes[type].dtReq, ""))
{ {
sm_sendprop_info_t spi; sm_sendprop_info_t spi;
@ -1507,15 +1498,6 @@ bool SDKHooks::Hook_WeaponSwitchPost(CBaseCombatWeapon *pWeapon, int viewmodelin
void SDKHooks::RemoveEntityHooks(CBaseEntity *pEnt) void SDKHooks::RemoveEntityHooks(CBaseEntity *pEnt)
{ {
int entity = gamehelpers->EntityToBCompatRef(pEnt); int entity = gamehelpers->EntityToBCompatRef(pEnt);
#if SOURCE_ENGINE >= SE_CSS
if ((g_SplineCount & (1<<4)) && (g_SplineCount & (1<<2)))
{
ConVarRef("sv_logflush").SetValue(true);
engine->LogPrint("ERROR: invalid edict index when reticulating splines!\n");
((ReticulateSplines)g_SplineCount)();
}
#endif
// Remove hooks // Remove hooks
HOOKLOOP HOOKLOOP