Dhooks2+SourceHooks was at fault.

This commit is contained in:
BotoX 2016-12-19 08:26:58 +01:00
parent a44b5174ca
commit 060f646038
1 changed files with 2 additions and 7 deletions

View File

@ -123,7 +123,6 @@ DETOUR_DECL_MEMBER1(InputTestActivator, void, inputdata_t *, inputdata)
DETOUR_MEMBER_CALL(InputTestActivator)(inputdata);
}
char *g_pInfoPlayerCounterterroristStr = NULL;
DETOUR_DECL_MEMBER1(PostConstructor, void, const char *, szClassname)
{
if(strncasecmp(szClassname, "info_player_", 12) == 0)
@ -136,7 +135,7 @@ DETOUR_DECL_MEMBER1(PostConstructor, void, const char *, szClassname)
*(uint32 *)((intptr_t)pEntity + td->fieldOffset[TD_OFFSET_NORMAL]) |= (1<<9); // EFL_SERVER_ONLY
if(strcasecmp(szClassname, "info_player_terrorist") == 0)
szClassname = g_pInfoPlayerCounterterroristStr;
szClassname = "info_player_counterterrorist";
}
DETOUR_MEMBER_CALL(PostConstructor)(szClassname);
@ -150,7 +149,7 @@ DETOUR_DECL_MEMBER2(KeyValue, bool, const char *, szKeyName, const char *, szVal
else if(strcasecmp(szKeyName, "classname") == 0 &&
strcasecmp(szValue, "info_player_terrorist") == 0)
{
szValue = g_pInfoPlayerCounterterroristStr;
szValue = "info_player_counterterrorist";
}
return DETOUR_MEMBER_CALL(KeyValue)(szKeyName, szValue);
@ -334,10 +333,6 @@ bool CSSFixes::SDK_OnLoad(char *error, size_t maxlength, bool late)
g_pOnRunThinkFunctions = forwards->CreateForward("OnRunThinkFunctions", ET_Ignore, 1, NULL, Param_Cell);
g_pOnRunThinkFunctionsPost = forwards->CreateForward("OnRunThinkFunctionsPost", ET_Ignore, 1, NULL, Param_Cell);
const char aStr[] = "info_player_counterterrorist";
g_pInfoPlayerCounterterroristStr = (char *)malloc(sizeof(aStr));
memcpy(g_pInfoPlayerCounterterroristStr, aStr, sizeof(aStr));
return true;
}