Merge pull request #341 from WPMGPRoSToTeMa/master

Fakemeta: fixed bug with recursive pre hooks (one returned supercede …
This commit is contained in:
Vincent Herbet 2016-01-26 17:32:11 +01:00
commit cba4c74f94
3 changed files with 7 additions and 10 deletions

View File

@ -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;
} }

View File

@ -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

View File

@ -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; \