Fixed forward bugs

This commit is contained in:
David Anderson 2005-10-18 21:29:51 +00:00
parent d2fb486e70
commit 3ced207dd3

View File

@ -17,57 +17,57 @@
#define SIMPLE_CONSTSTRING_HOOK_INT(call) \
const char* call (int v) \
{ \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i),v)); \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i),(cell)v)); \
RETURN_META_VALUE(mswi(lastFmRes), mlStringResult); \
} \
const char* call##_post (int v) \
{ \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i),v)); \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i),(cell)v)); \
RETURN_META_VALUE(MRES_IGNORED, mlStringResult); \
}
#define SIMPLE_CONSTSTRING_HOOK_CONSTEDICT(call) \
const char* call (const edict_t *e) \
{ \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i),ENTINDEX((edict_t*)e))); \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i),(cell)ENTINDEX((edict_t*)e))); \
RETURN_META_VALUE(mswi(lastFmRes), mlStringResult); \
} \
const char* call##_post (const edict_t *e) \
{ \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i),ENTINDEX((edict_t*)e))); \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i),(cell)ENTINDEX((edict_t*)e))); \
RETURN_META_VALUE(MRES_IGNORED, mlStringResult); \
}
#define SIMPLE_CONSTSTRING_HOOK_CONSTEDICT_CONSTSTRING(call) \
const char* call (const edict_t *e, const char *c) \
{ \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i),ENTINDEX((edict_t*)e),c)); \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i),(cell)ENTINDEX((edict_t*)e),c)); \
RETURN_META_VALUE(mswi(lastFmRes), mlStringResult); \
} \
const char* call##_post (const edict_t *e, const char *c) \
{ \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i),ENTINDEX((edict_t*)e),c)); \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i),(cell)ENTINDEX((edict_t*)e),c)); \
RETURN_META_VALUE(MRES_IGNORED, mlStringResult); \
}
#define SIMPLE_VOID_HOOK_CONSTEDICT_INT_INT_INT_INT(call) \
void call (const edict_t *e, int v, int vb, int vc, int vd) \
{ \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i),ENTINDEX((edict_t*)e),v,vb,vc,vd)); \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i),(cell)ENTINDEX((edict_t*)e),(cell)v,(cell)vb,(cell)vc,(cell)vd)); \
RETURN_META(mswi(lastFmRes)); \
} \
void call##_post (const edict_t *e, int v, int vb, int vc, int vd) \
{ \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i),ENTINDEX((edict_t*)e),v,vb,vc,vd)); \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i),(cell)ENTINDEX((edict_t*)e),(cell)v,(cell)vb,(cell)vc,(cell)vd)); \
RETURN_META(MRES_IGNORED); \
}
#define SIMPLE_VOID_HOOK_INT_STRING_STRING_STRING(call) \
void call (int v,char *c, char *cb, char *cc) \
{ \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i),v,c,cb,cc)); \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i),(cell)v,c,cb,cc)); \
RETURN_META(mswi(lastFmRes)); \
} \
void call##_post (int v, char *c, char *cb, char *cc) \
{ \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i),v,c,cb,cc)); \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i),(cell)v,c,cb,cc)); \
RETURN_META(MRES_IGNORED); \
}
@ -97,23 +97,23 @@
#define SIMPLE_CONSTSTRING_HOOK_EDICT(call) \
const char* call (edict_t *e) \
{ \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i),ENTINDEX(e))); \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i),(cell)ENTINDEX(e))); \
RETURN_META_VALUE(mswi(lastFmRes), mlStringResult); \
} \
const char* call##_post (edict_t *e) \
{ \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i),ENTINDEX(e))); \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i),(cell)ENTINDEX(e))); \
RETURN_META_VALUE(MRES_IGNORED, mlStringResult); \
}
#define SIMPLE_VOID_HOOK_CONSTEDICT_CONSTSTRING_CONSTSTRING(call) \
void call (const edict_t *e, const char *c, const char *cb) \
{ \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i),ENTINDEX((edict_t*)e),c,cb)); \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i),(cell)ENTINDEX((edict_t*)e),c,cb)); \
RETURN_META(mswi(lastFmRes)); \
} \
void call##_post (const edict_t *e, const char *c, const char *cb) \
{ \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i),ENTINDEX((edict_t*)e),c,cb)); \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i),(cell)ENTINDEX((edict_t*)e),c,cb)); \
RETURN_META(MRES_IGNORED); \
}
@ -192,36 +192,36 @@
#define SIMPLE_VOID_HOOK_INT_CONSTSTRING(call) \
void call (int v, const char *s) \
{ \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i), v, s)); \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i), (cell)v, s)); \
RETURN_META(mswi(lastFmRes)); \
} \
void call##_post (int v,const char *s) \
{ \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i), v, s)); \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i), (cell)v, s)); \
RETURN_META(MRES_IGNORED); \
}
#define SIMPLE_VOID_HOOK_CONSTSTRING_FLOAT(call) \
void call (const char *s, float f) \
{ \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i), s, f)); \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i), s, amx_ftoc(f))); \
RETURN_META(mswi(lastFmRes)); \
} \
void call##_post (const char *s, float f) \
{ \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i), s, f)); \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i), s, (cell)amx_ftoc(f))); \
RETURN_META(MRES_IGNORED); \
}
#define SIMPLE_INT_HOOK_CONSTSTRING_INT(call) \
int call (const char *s, int v) \
{ \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i), s, v)); \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i), s, (cell)v)); \
RETURN_META_VALUE(mswi(lastFmRes),(int)mlCellResult); \
} \
int call##_post (const char *s, int v) \
{ \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i), s, v)); \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i), s, (cell)v)); \
RETURN_META_VALUE(MRES_IGNORED,(int)mlCellResult); \
}
@ -241,36 +241,36 @@
#define SIMPLE_USHORT_HOOK_INT_CONSTSTRING(call) \
unsigned short call (int v, const char *s) \
{ \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i), v, s)); \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i), (cell)v, s)); \
RETURN_META_VALUE(mswi(lastFmRes),(unsigned short)mlCellResult); \
} \
unsigned short call##_post (int v,const char *s) \
{ \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i), v, s)); \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i),(cell)v, s)); \
RETURN_META_VALUE(MRES_IGNORED,(unsigned short)mlCellResult); \
}
#define SIMPLE_VOID_HOOK_INT_STRING(call) \
void call (int v, char *s) \
{ \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i), v, s)); \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i), (cell)v, s)); \
RETURN_META(mswi(lastFmRes)); \
} \
void call##_post (int v,char *s) \
{ \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i), v, s)); \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i), (cell)v, s)); \
RETURN_META(MRES_IGNORED); \
}
#define SIMPLE_VOID_HOOK_INT(call) \
void call (int v) \
{ \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i), v)); \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i), (cell)v)); \
RETURN_META(mswi(lastFmRes)); \
} \
void call##_post (int v) \
{ \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i), v)); \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i), (cell)v)); \
RETURN_META(MRES_IGNORED); \
}
@ -284,30 +284,31 @@
} \
void call##_post (float v) \
{ \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i), v)); \
PREPARE_FLOAT(v); \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i), c_v)); \
RETURN_META(MRES_IGNORED); \
}
#define SIMPLE_VOID_HOOK_CONSTEDICT_FLOAT(call) \
void call (const edict_t *ent, float blah) \
{ \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i), ENTINDEX((edict_t*)ent), amx_ftoc(blah))); \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i), (cell)ENTINDEX((edict_t*)ent), (cell)amx_ftoc(blah))); \
RETURN_META(mswi(lastFmRes)); \
} \
void call##_post (const edict_t *ent, float blah) \
{ \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i), ENTINDEX((edict_t*)ent), amx_ftoc(blah))); \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i), (cell)ENTINDEX((edict_t*)ent), (cell)amx_ftoc(blah))); \
RETURN_META(MRES_IGNORED); \
}
#define SIMPLE_VOID_HOOK_CONSTEDICT_FLOAT_FLOAT(call) \
void call (const edict_t *ent, float blah, float blahb) \
{ \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i), ENTINDEX((edict_t*)ent), amx_ftoc(blah), amx_ftoc(blahb))); \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i), (cell)ENTINDEX((edict_t*)ent), (cell)amx_ftoc(blah), (cell)amx_ftoc(blahb))); \
RETURN_META(mswi(lastFmRes)); \
} \
void call##_post (const edict_t *ent, float blah, float blahb) \
{ \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i), ENTINDEX((edict_t*)ent), amx_ftoc(blah), amx_ftoc(blahb))); \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i), (cell)ENTINDEX((edict_t*)ent), (cell)amx_ftoc(blah), (cell)amx_ftoc(blahb))); \
RETURN_META(MRES_IGNORED); \
}
@ -316,12 +317,12 @@
#define SIMPLE_VOID_HOOK_EDICT(call) \
void call (edict_t *ent) \
{ \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i), ENTINDEX(ent))); \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i), (cell)ENTINDEX(ent))); \
RETURN_META(mswi(lastFmRes)); \
} \
void call##_post (edict_t *ent) \
{ \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i), ENTINDEX(ent))); \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i), (cell)ENTINDEX(ent))); \
RETURN_META(MRES_IGNORED); \
}
#define SIMPLE_EDICT_HOOK_VOID(call) \
@ -350,12 +351,12 @@
#define SIMPLE_EDICT_HOOK_EDICT(call) \
edict_t* call (edict_t *e) \
{ \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i),ENTINDEX(e))); \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i),(cell)ENTINDEX(e))); \
RETURN_META_VALUE(mswi(lastFmRes),INDEXENT2((int)mlCellResult)); \
} \
edict_t* call##_post (edict_t *e) \
{ \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i),ENTINDEX(e))); \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i),(cell)ENTINDEX(e))); \
RETURN_META_VALUE(MRES_IGNORED,INDEXENT2((int)mlCellResult)); \
}
@ -363,13 +364,13 @@
edict_t* call (edict_t *ed, const float *vec, float fla) \
{ \
PREPARE_VECTOR(vec); \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i), ENTINDEX(ed), p_vec, fla)); \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i), (cell)ENTINDEX(ed), p_vec, (cell)amx_ftoc(fla))); \
RETURN_META_VALUE(mswi(lastFmRes), INDEXENT2((int)mlCellResult)); \
} \
edict_t* call##_post (edict_t *ed, const float *vec, float fla) \
{ \
PREPARE_VECTOR(vec); \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i), ENTINDEX(ed), p_vec, fla)); \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i), (cell)ENTINDEX(ed), p_vec, (cell)amx_ftoc(fla))); \
RETURN_META_VALUE(MRES_IGNORED, INDEXENT2((int)mlCellResult)); \
}
@ -389,12 +390,12 @@
#define SIMPLE_VOID_HOOK_CONSTEDICT_CONSTEDICT(call) \
void call (const edict_t *ent,const edict_t *entb) \
{ \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i), ENTINDEX((edict_t*)ent), ENTINDEX((edict_t*)entb))); \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i), (cell)ENTINDEX((edict_t*)ent), (cell)ENTINDEX((edict_t*)entb))); \
RETURN_META(mswi(lastFmRes)); \
} \
void call##_post (const edict_t *ent,const edict_t *entb) \
{ \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i), ENTINDEX((edict_t*)ent), ENTINDEX((edict_t*)entb))); \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i), (cell)ENTINDEX((edict_t*)ent), (cell)ENTINDEX((edict_t*)entb))); \
RETURN_META(MRES_IGNORED); \
}
@ -413,83 +414,83 @@
#define SIMPLE_INT_HOOK_EDICT(call) \
int call (edict_t *pent) \
{ \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i), ENTINDEX(pent))); \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i), (cell)ENTINDEX(pent))); \
RETURN_META_VALUE(mswi(lastFmRes), (int)mlCellResult); \
} \
int call##_post (edict_t *pent) \
{ \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i), ENTINDEX(pent))); \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i), (cell)ENTINDEX(pent))); \
RETURN_META_VALUE(MRES_IGNORED, (int)mlCellResult); \
}
#define SIMPLE_UINT_HOOK_EDICT(call) \
unsigned int call (edict_t *pent) \
{ \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i), ENTINDEX(pent))); \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i), (cell)ENTINDEX(pent))); \
RETURN_META_VALUE(mswi(lastFmRes), (unsigned int)mlCellResult); \
} \
unsigned int call##_post (edict_t *pent) \
{ \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i), ENTINDEX(pent))); \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i), (cell)ENTINDEX(pent))); \
RETURN_META_VALUE(MRES_IGNORED, (unsigned int)mlCellResult); \
}
#define SIMPLE_INT_HOOK_CONSTEDICT(call) \
int call (const edict_t *pent) \
{ \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i), ENTINDEX((edict_t*)pent))); \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i), (cell)ENTINDEX((edict_t*)pent))); \
RETURN_META_VALUE(mswi(lastFmRes), (int)mlCellResult); \
} \
int call##_post (const edict_t *pent) \
{ \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i), ENTINDEX((edict_t*)pent))); \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i), (cell)ENTINDEX((edict_t*)pent))); \
RETURN_META_VALUE(MRES_IGNORED, (int)mlCellResult); \
}
#define SIMPLE_INT_HOOK_INT(call) \
int call (int v) \
{ \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i), v)); \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i), (cell)v)); \
RETURN_META_VALUE(mswi(lastFmRes), (int)mlCellResult); \
} \
int call##_post (int v) \
{ \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i), v)); \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i), (cell)v)); \
RETURN_META_VALUE(MRES_IGNORED, (int)mlCellResult); \
}
#define SIMPLE_VOID_HOOK_INT_INT(call) \
void call (int v, int vb) \
{ \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i), v, vb)); \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i), (cell)v, (cell)vb)); \
RETURN_META(mswi(lastFmRes)); \
} \
void call##_post (int v, int vb) \
{ \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i), v, vb)); \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i), (cell)v, (cell)vb)); \
RETURN_META(MRES_IGNORED); \
}
#define SIMPLE_BOOL_HOOK_INT_INT(call) \
qboolean call (int v, int vb) \
{ \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i), v, vb)); \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i), (cell)v, (cell)vb)); \
RETURN_META_VALUE(mswi(lastFmRes), (int)mlCellResult > 0 ? 1 : 0); \
} \
qboolean call##_post (int v, int vb) \
{ \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i), v, vb)); \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i), (cell)v, (cell)vb)); \
RETURN_META_VALUE(MRES_IGNORED, (int)mlCellResult > 0 ? 1 : 0); \
}
#define SIMPLE_BOOL_HOOK_INT_INT_BOOL(call) \
qboolean call (int v, int vb, qboolean bah) \
{ \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i), v, vb, bah > 0 ? 1 : 0)); \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i), (cell) v, (cell)vb, (cell)(bah > 0 ? 1 : 0))); \
RETURN_META_VALUE(mswi(lastFmRes), (int)mlCellResult > 0 ? 1 : 0); \
} \
qboolean call##_post (int v, int vb, qboolean bah) \
{ \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i), v, vb, bah > 0 ? 1 : 0)); \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i), (cell)v, (cell)vb, (cell)(bah > 0 ? 1 : 0))); \
RETURN_META_VALUE(MRES_IGNORED, (int)mlCellResult > 0 ? 1 : 0); \
}
@ -535,13 +536,13 @@
void call (edict_t *e, const float *vec) \
{ \
PREPARE_VECTOR(vec); \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i), ENTINDEX(e), p_vec)); \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i), (cell)ENTINDEX(e), p_vec)); \
RETURN_META(mswi(lastFmRes)); \
} \
void call##_post (edict_t *e, const float *vec) \
{ \
PREPARE_VECTOR(vec); \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i), ENTINDEX(e), p_vec)); \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i), (cell)ENTINDEX(e), p_vec)); \
RETURN_META(MRES_IGNORED); \
}
@ -549,13 +550,13 @@
void call (edict_t *e, float f, float *vec) \
{ \
PREPARE_VECTOR(vec); \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i), ENTINDEX(e), f, p_vec)); \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i), (cell)ENTINDEX(e), (cell)amx_ftoc(f), p_vec)); \
RETURN_META(mswi(lastFmRes)); \
} \
void call##_post (edict_t *e, float f, float *vec) \
{ \
PREPARE_VECTOR(vec); \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i), ENTINDEX(e), f, p_vec)); \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i), (cell)ENTINDEX(e), (cell)amx_ftoc(f), p_vec)); \
RETURN_META(MRES_IGNORED); \
}
@ -599,14 +600,14 @@
{ \
PREPARE_VECTOR(vec); \
PREPARE_VECTOR(vecb); \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i), ENTINDEX(e), p_vec, p_vecb)); \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i), (cell)ENTINDEX(e), p_vec, p_vecb)); \
RETURN_META(mswi(lastFmRes)); \
} \
void call##_post (edict_t *e, const float *vec, const float *vecb) \
{ \
PREPARE_VECTOR(vec); \
PREPARE_VECTOR(vecb); \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i), ENTINDEX(e), p_vec, p_vecb)); \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i), (cell)ENTINDEX(e), p_vec, p_vecb)); \
RETURN_META(MRES_IGNORED); \
}
@ -652,11 +653,11 @@
{ \
if (vec) { \
PREPARE_VECTOR(vec); \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i), v, vb, p_vec, ENTINDEX(e))); \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i), (cell)v, (cell)vb, p_vec, (cell)ENTINDEX(e))); \
} else { \
const float b[3]={0.0,0.0,0.0}; \
PREPARE_VECTOR(b); \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i), v, vb, p_b, ENTINDEX(e))); \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i), (cell)v, vb, p_b, (cell)ENTINDEX(e))); \
} \
RETURN_META(mswi(lastFmRes)); \
} \
@ -664,34 +665,34 @@
{ \
if (vec) { \
PREPARE_VECTOR(vec); \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i), v, vb, p_vec, ENTINDEX(e))); \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i), (cell)v, (cell)vb, p_vec, (cell)ENTINDEX(e))); \
} else { \
const float b[3]={0.0,0.0,0.0}; \
PREPARE_VECTOR(b); \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i), v, vb, p_b, ENTINDEX(e))); \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i), (cell)v, (cell)vb, p_b, (cell)ENTINDEX(e))); \
} \
RETURN_META(MRES_IGNORED); \
}
#define SIMPLE_BOOL_HOOK_EDICT_CONSTSTRING_CONSTSTRING_STRING128(call) \
qboolean call (edict_t *e, const char *sza, const char *szb, char blah[128]) \
{ \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i), ENTINDEX(e), sza, szb, blah)); \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i), (cell)ENTINDEX(e), sza, szb, blah)); \
RETURN_META_VALUE(mswi(lastFmRes),(int)mlCellResult > 0 ? 0 : 1); \
} \
qboolean call##_post (edict_t *e, const char *sza, const char *szb, char blah[128]) \
{ \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i), ENTINDEX(e), sza, szb, blah)); \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i), (cell)ENTINDEX(e), sza, szb, blah)); \
RETURN_META_VALUE(MRES_IGNORED,(int)mlCellResult > 0 ? 0 : 1); \
}
#define SIMPLE_VOID_HOOK_EDICT_INT_CONSTSTRING_FLOAT_FLOAT_INT_INT(call) \
void call (edict_t *e, int v, const char *sz, float f, float fb, int vb, int vc) \
{ \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i), ENTINDEX(e), v, sz, f, fb, vb, vc)); \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i), (cell)ENTINDEX(e), (cell)v, sz, (cell)amx_ftoc(f), (cell)amx_ftoc(fb), (cell)vb, (cell)vc)); \
RETURN_META(mswi(lastFmRes)); \
} \
void call##_post (edict_t *e, int v, const char *sz, float f, float fb, int vb, int vc) \
{ \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i), ENTINDEX(e), v, sz, f, fb, vb, vc)); \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i), (cell)ENTINDEX(e), (cell)v, sz, (cell)amx_ftoc(f), (cell)amx_ftoc(fb), (cell)vb, (cell)vc)); \
RETURN_META(MRES_IGNORED); \
}
@ -699,13 +700,13 @@
void call (edict_t *e, float *vec, const char *sz, float f, float fb, int vb, int vc) \
{ \
PREPARE_VECTOR(vec); \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i), ENTINDEX(e), p_vec, sz, f, fb, vb, vc)); \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i), (cell)ENTINDEX(e), p_vec, sz, (cell)amx_ftoc(f), (cell)amx_ftoc(fb), (cell)vb, (cell)vc)); \
RETURN_META(mswi(lastFmRes)); \
} \
void call##_post (edict_t *e, float *vec, const char *sz, float f, float fb, int vb, int vc) \
{ \
PREPARE_VECTOR(vec); \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i), ENTINDEX(e), p_vec, sz, f, fb, vb, vc)); \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i), (cell)ENTINDEX(e), p_vec, sz, (cell)amx_ftoc(f), (cell)amx_ftoc(fb), (cell)vb, (cell)vc)); \
RETURN_META(MRES_IGNORED); \
}
//int flags, const edict_t *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2 );
@ -714,14 +715,14 @@
{ \
PREPARE_VECTOR(vec); \
PREPARE_VECTOR(vecb); \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i), v, ENTINDEX((edict_t*)e), eb, f, p_vec, p_vecb, fb, fc, vb, vc, vd, ve)); \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i), (cell)v, (cell)ENTINDEX((edict_t*)e), (cell)eb, (cell)amx_ftoc(f), p_vec, p_vecb, (cell)amx_ftoc(fb), (cell)amx_ftoc(fc), (cell)vb, (cell)vc, (cell)vd, (cell)ve)); \
RETURN_META(mswi(lastFmRes)); \
} \
void call##_post (int v, const edict_t *e, unsigned short eb, float f, float *vec, float *vecb, float fb, float fc, int vb, int vc, int vd, int ve) \
{ \
PREPARE_VECTOR(vec); \
PREPARE_VECTOR(vecb); \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i), v, ENTINDEX((edict_t*)e), eb, f, p_vec, p_vecb, fb, fc, vb, vc, vd, ve)); \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i), (cell)v, (cell)ENTINDEX((edict_t*)e),(cell)eb, f, p_vec, p_vecb, (cell)amx_ftoc(fb), (cell)amx_ftoc(fc), (cell)vb, (cell)vc, (cell)vd, (cell)ve)); \
RETURN_META(MRES_IGNORED); \
}
@ -731,14 +732,14 @@
{ \
PREPARE_VECTOR(vec); \
PREPARE_VECTOR(vecb); \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i), p_vec, p_vecb, fla, flb)); \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i), p_vec, p_vecb, (cell)amx_ftoc(fla), (cell)amx_ftoc(flb))); \
RETURN_META(mswi(lastFmRes)); \
} \
void call##_post (const float *vec,const float *vecb, float fla, float flb) \
{ \
PREPARE_VECTOR(vec); \
PREPARE_VECTOR(vecb); \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i), vec, vecb, fla, flb)); \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i), p_vec, p_vecb, (cell)amx_ftoc(fla), (cell)amx_ftoc(flb))); \
RETURN_META(MRES_IGNORED); \
}
@ -759,12 +760,12 @@
#define SIMPLE_INT_HOOK_EDICT_EDICT(call) \
int call (edict_t *pent,edict_t *pentb) \
{ \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i), ENTINDEX(pent), ENTINDEX(pentb))); \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i), (cell)ENTINDEX(pent), (cell)ENTINDEX(pentb))); \
RETURN_META_VALUE(mswi(lastFmRes), (int)mlCellResult); \
} \
int call##_post (edict_t *pent,edict_t *pentb) \
{ \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i), ENTINDEX(pent), ENTINDEX(pentb))); \
FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i), (cell)ENTINDEX(pent), (cell)ENTINDEX(pentb))); \
RETURN_META_VALUE(MRES_IGNORED, (int)mlCellResult); \
}