Allow null invoker to be passed in EngFunc_PlayBackEvent

This commit is contained in:
Arkshine 2016-03-02 13:29:19 +01:00
parent f981aa34dc
commit 494444a433
2 changed files with 8 additions and 4 deletions

View File

@ -899,7 +899,11 @@ static cell AMX_NATIVE_CALL engfunc(AMX *amx, cell *params)
iparam1 = cRet[0]; iparam1 = cRet[0];
cRet = MF_GetAmxAddr(amx,params[3]); cRet = MF_GetAmxAddr(amx,params[3]);
index = cRet[0]; index = cRet[0];
if (index != -1)
{
CHECK_ENTITY(index); CHECK_ENTITY(index);
pRet = TypeConversion.id_to_edict(index);
}
cRet = MF_GetAmxAddr(amx,params[4]); cRet = MF_GetAmxAddr(amx,params[4]);
iparam2 = cRet[0]; iparam2 = cRet[0];
cRet = MF_GetAmxAddr(amx,params[5]); cRet = MF_GetAmxAddr(amx,params[5]);
@ -924,7 +928,7 @@ static cell AMX_NATIVE_CALL engfunc(AMX *amx, cell *params)
iparam5 = cRet[0]; iparam5 = cRet[0];
cRet = MF_GetAmxAddr(amx,params[13]); cRet = MF_GetAmxAddr(amx,params[13]);
iparam6 = cRet[0]; iparam6 = cRet[0];
(*g_engfuncs.pfnPlaybackEvent)(iparam1,TypeConversion.id_to_edict(index),iparam2,fparam1,Vec1,Vec2,fparam2,fparam3,iparam3,iparam4,iparam5,iparam6); (*g_engfuncs.pfnPlaybackEvent)(iparam1,pRet,iparam2,fparam1,Vec1,Vec2,fparam2,fparam3,iparam3,iparam4,iparam5,iparam6);
return 1; return 1;
//pfnCheckVisibility //pfnCheckVisibility

View File

@ -814,14 +814,14 @@
{ \ { \
PREPARE_VECTOR(vec); \ PREPARE_VECTOR(vec); \
PREPARE_VECTOR(vecb); \ PREPARE_VECTOR(vecb); \
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i), (cell)v, (cell)ENTINDEX((edict_t*)e), (cell)eb, f, p_vec, p_vecb, fb, fc, (cell)vb, (cell)vc, (cell)vd, (cell)ve)); \ FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i), (cell)v, e ? (cell)ENTINDEX((edict_t*)e) : -1, (cell)eb, f, p_vec, p_vecb, fb, fc, (cell)vb, (cell)vc, (cell)vd, (cell)ve)); \
RETURN_META(mswi(lastFmRes)); \ 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) \ 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(vec); \
PREPARE_VECTOR(vecb); \ PREPARE_VECTOR(vecb); \
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, fb, fc, (cell)vb, (cell)vc, (cell)vd, (cell)ve)); \ FM_ENG_HANDLE_POST(FM_##call, (EnginePost[FM_##call].at(i), (cell)v, e ? (cell)ENTINDEX((edict_t*)e) : -1, (cell)eb, f, p_vec, p_vecb, fb, fc, (cell)vb, (cell)vc, (cell)vd, (cell)ve)); \
RETURN_META(MRES_IGNORED); \ RETURN_META(MRES_IGNORED); \
} }