Fakemeta: fixed bug with recursive pre hooks (one returned supercede can supercede several hooks)
This commit is contained in:
parent
0462ca02c8
commit
3c74e72242
|
@ -24,7 +24,6 @@ float mlFloatResult;
|
||||||
const char *mStringResult;
|
const char *mStringResult;
|
||||||
const char *mlStringResult;
|
const char *mlStringResult;
|
||||||
int retType = 0;
|
int retType = 0;
|
||||||
int lastFmRes = FMRES_IGNORED;
|
|
||||||
KVD_Wrapper g_kvd_hook;
|
KVD_Wrapper g_kvd_hook;
|
||||||
clientdata_t *g_cd_hook;
|
clientdata_t *g_cd_hook;
|
||||||
entity_state_t *g_es_hook;
|
entity_state_t *g_es_hook;
|
||||||
|
@ -55,7 +54,6 @@ void clfm()
|
||||||
mlCellResult = 0;
|
mlCellResult = 0;
|
||||||
mStringResult = "";
|
mStringResult = "";
|
||||||
mlStringResult = "";
|
mlStringResult = "";
|
||||||
lastFmRes = FMRES_IGNORED;
|
|
||||||
mFloatResult = 0.0;
|
mFloatResult = 0.0;
|
||||||
mlFloatResult = 0.0;
|
mlFloatResult = 0.0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -193,7 +193,6 @@ extern const char *mStringResult;
|
||||||
extern cell mlCellResult;
|
extern cell mlCellResult;
|
||||||
extern float mlFloatResult;
|
extern float mlFloatResult;
|
||||||
extern const char *mlStringResult;
|
extern const char *mlStringResult;
|
||||||
extern int lastFmRes;
|
|
||||||
extern int retType;
|
extern int retType;
|
||||||
|
|
||||||
#endif //_INCLUDE_FORWARD_H
|
#endif //_INCLUDE_FORWARD_H
|
||||||
|
|
|
@ -751,14 +751,12 @@
|
||||||
#define SIMPLE_VOID_HOOK_INT_INT_CONSTVECT_EDICT(call) \
|
#define SIMPLE_VOID_HOOK_INT_INT_CONSTVECT_EDICT(call) \
|
||||||
void call (int v, int vb, const float *vec, edict_t *e) \
|
void call (int v, int vb, const float *vec, edict_t *e) \
|
||||||
{ \
|
{ \
|
||||||
if (vec) { \
|
const float b[3]={0.0,0.0,0.0}; \
|
||||||
PREPARE_VECTOR(vec); \
|
if (vec == nullptr) { \
|
||||||
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i), (cell)v, (cell)vb, p_vec, (cell)ENTINDEX(e))); \
|
vec = b; \
|
||||||
} else { \
|
|
||||||
const float b[3]={0.0,0.0,0.0}; \
|
|
||||||
PREPARE_VECTOR(b); \
|
|
||||||
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i), (cell)v, (cell)vb, p_b, (cell)ENTINDEX(e))); \
|
|
||||||
} \
|
} \
|
||||||
|
PREPARE_VECTOR(vec); \
|
||||||
|
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i), (cell)v, (cell)vb, p_vec, (cell)ENTINDEX(e))); \
|
||||||
RETURN_META(mswi(lastFmRes)); \
|
RETURN_META(mswi(lastFmRes)); \
|
||||||
} \
|
} \
|
||||||
void call##_post (int v, int vb, const float *vec, edict_t *e) \
|
void call##_post (int v, int vb, const float *vec, edict_t *e) \
|
||||||
|
@ -924,6 +922,7 @@
|
||||||
register unsigned int i = 0; \
|
register unsigned int i = 0; \
|
||||||
clfm(); \
|
clfm(); \
|
||||||
int fmres = FMRES_IGNORED; \
|
int fmres = FMRES_IGNORED; \
|
||||||
|
int lastFmRes = FMRES_IGNORED; \
|
||||||
for (i=0; i<Engine[pfnCall].length(); i++) \
|
for (i=0; i<Engine[pfnCall].length(); i++) \
|
||||||
{ \
|
{ \
|
||||||
fmres = MF_ExecuteForward pfnArgs; \
|
fmres = MF_ExecuteForward pfnArgs; \
|
||||||
|
@ -941,6 +940,7 @@
|
||||||
register unsigned int i = 0; \
|
register unsigned int i = 0; \
|
||||||
clfm(); \
|
clfm(); \
|
||||||
int fmres = FMRES_IGNORED; \
|
int fmres = FMRES_IGNORED; \
|
||||||
|
int lastFmRes = FMRES_IGNORED; \
|
||||||
for (i=0; i<EnginePost[pfnCall].length(); i++) \
|
for (i=0; i<EnginePost[pfnCall].length(); i++) \
|
||||||
{ \
|
{ \
|
||||||
fmres = MF_ExecuteForward pfnArgs; \
|
fmres = MF_ExecuteForward pfnArgs; \
|
||||||
|
|
Loading…
Reference in New Issue
Block a user