fixed bug am50501
This commit is contained in:
parent
b324e8ed9d
commit
7f3c2d00ac
|
@ -34,19 +34,25 @@ void ServerActivate(edict_t *pEdictList, int edictCount, int clientMax)
|
|||
g_pFunctionTable->pfn##tcall =0; \
|
||||
g_pFunctionTable_Post->pfn##tcall =NULL; \
|
||||
Engine[FM_##tcall].clear(); \
|
||||
EnginePost[FM_##tcall].clear()
|
||||
EnginePost[FM_##tcall].clear(); \
|
||||
EngineAddrs[FM_##tcall] = NULL; \
|
||||
EngineAddrsPost[FM_##tcall] = NULL;
|
||||
|
||||
#define RESETE(call) \
|
||||
g_pengfuncsTable->pfn##call = NULL; \
|
||||
g_pengfuncsTable_Post->pfn##call = NULL; \
|
||||
Engine[FM_##call].clear(); \
|
||||
EnginePost[FM_##call].clear()
|
||||
EnginePost[FM_##call].clear(); \
|
||||
EngineAddrs[FM_##call] = NULL; \
|
||||
EngineAddrsPost[FM_##call] = NULL;
|
||||
|
||||
#define RESETN(call) \
|
||||
g_pNewFunctionsTable->pfn##call = NULL; \
|
||||
g_pNewFunctionsTable_Post->pfn##call = NULL; \
|
||||
Engine[FM_##call].clear(); \
|
||||
EnginePost[FM_##call].clear();
|
||||
EnginePost[FM_##call].clear(); \
|
||||
EngineAddrs[FM_##call] = NULL; \
|
||||
EngineAddrsPost[FM_##call] = NULL;
|
||||
|
||||
void FMH_ServerDeactivate_Post()
|
||||
{
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
CVector<int> Engine[ENGFUNC_NUM+10];
|
||||
CVector<int> EnginePost[ENGFUNC_NUM+10];
|
||||
void *EngineAddrs[ENGFUNC_NUM+10];
|
||||
void *EngineAddrsPost[ENGFUNC_NUM+10];
|
||||
cell mCellResult;
|
||||
cell mlCellResult;
|
||||
float mFloatResult;
|
||||
|
@ -819,11 +821,17 @@ static cell AMX_NATIVE_CALL unregister_forward(AMX *amx, cell *params)
|
|||
return 0;
|
||||
}
|
||||
|
||||
void *patchAddr = NULL;
|
||||
|
||||
CVector<int> *peng = NULL;
|
||||
if (post)
|
||||
{
|
||||
peng = &(EnginePost[func]);
|
||||
else
|
||||
patchAddr = EngineAddrsPost[func];
|
||||
} else {
|
||||
peng = &(Engine[func]);
|
||||
patchAddr = EngineAddrs[func];
|
||||
}
|
||||
|
||||
CVector<int>::iterator begin, end=peng->end();
|
||||
|
||||
|
@ -832,10 +840,12 @@ static cell AMX_NATIVE_CALL unregister_forward(AMX *amx, cell *params)
|
|||
if ((*begin) == func_id)
|
||||
{
|
||||
peng->erase(begin);
|
||||
if (!peng->size())
|
||||
if (!peng->size()
|
||||
&& patchAddr != NULL
|
||||
&& func != FM_ServerDeactivate)
|
||||
{
|
||||
//:TODO: we should probably clear this here!
|
||||
//but, we have no reverse lookup possible.
|
||||
/* Clear out this forward if we no longer need it */
|
||||
*(void **)patchAddr = NULL;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -169,6 +169,8 @@ enum {
|
|||
|
||||
extern CVector<int> Engine[];
|
||||
extern CVector<int> EnginePost[];
|
||||
extern void *EngineAddrs[ENGFUNC_NUM+10];
|
||||
extern void *EngineAddrsPost[ENGFUNC_NUM+10];
|
||||
extern cell mCellResult;
|
||||
extern float mFloatResult;
|
||||
extern const char *mStringResult;
|
||||
|
|
|
@ -810,11 +810,13 @@
|
|||
#define ENGHOOK(pfnCall) \
|
||||
if (post) \
|
||||
{ \
|
||||
EngineAddrsPost[FM_##pfnCall] = &engtable->pfn##pfnCall; \
|
||||
if (engtable->pfn##pfnCall == NULL) \
|
||||
engtable->pfn##pfnCall = pfnCall##_post; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
EngineAddrs[FM_##pfnCall] = &engtable->pfn##pfnCall; \
|
||||
if (engtable->pfn##pfnCall == NULL) \
|
||||
engtable->pfn##pfnCall = pfnCall; \
|
||||
}
|
||||
|
@ -822,11 +824,13 @@
|
|||
#define DLLHOOK(pfnCall) \
|
||||
if (post) \
|
||||
{ \
|
||||
EngineAddrsPost[FM_##pfnCall] = &dlltable->pfn##pfnCall; \
|
||||
if (dlltable->pfn##pfnCall == NULL) \
|
||||
dlltable->pfn##pfnCall = pfnCall##_post; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
EngineAddrs[FM_##pfnCall] = &dlltable->pfn##pfnCall; \
|
||||
if (dlltable->pfn##pfnCall == NULL) \
|
||||
dlltable->pfn##pfnCall = pfnCall; \
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user