More bugs?

1) New hookable GameDLL func: CreateBaseline
2) New hookable Engine func: CreateInstancedBaseline
3) New GameDLL func that can be called via dllfunc: CreateBaseline
4) New GameDLL func that can be called via engfunc: CreateInstancedBaseline
This commit is contained in:
Scott Ehlert
2006-05-05 08:04:19 +00:00
parent 133c7d6815
commit ed19c53552
7 changed files with 107 additions and 12 deletions

View File

@ -610,6 +610,21 @@ SIMPLE_UINT_HOOK_EDICT(GetPlayerWONId);
SIMPLE_INT_HOOK_STRING(IsMapValid);
int CreateInstancedBaseline(int classname, struct entity_state_s *baseline)
{
g_es_hook = baseline;
FM_ENG_HANDLE(FM_CreateInstancedBaseline, (Engine[FM_CreateInstancedBaseline].at(i), (cell)classname, (cell)baseline));
RETURN_META_VALUE(mswi(lastFmRes), (int)mlCellResult);
}
int CreateInstancedBaseline_post(int classname, struct entity_state_s *baseline)
{
g_es_hook = baseline;
origCellRet = META_RESULT_ORIG_RET(int);
FM_ENG_HANDLE_POST(FM_CreateInstancedBaseline, (EnginePost[FM_CreateInstancedBaseline].at(i), (cell)classname, (cell)baseline));
RETURN_META_VALUE(MRES_IGNORED, (int)mlCellResult);
}
/*
* Beginning of Engine->Game DLL hooks
*/
@ -735,6 +750,24 @@ void CmdStart_post(const edict_t *player, const struct usercmd_s *cmd, unsigned
RETURN_META(MRES_IGNORED);
}
void CreateBaseline(int player, int eindex, struct entity_state_s *baseline, struct edict_s *entity, int playermodelindex, vec3_t player_mins, vec3_t player_maxs)
{
g_es_hook = baseline;
PREPARE_VECTOR(player_mins);
PREPARE_VECTOR(player_maxs);
FM_ENG_HANDLE(FM_CreateBaseline, (Engine[FM_CreateBaseline].at(i), (cell)player, (cell)eindex, (cell)baseline, (cell)ENTINDEX(entity), (cell)playermodelindex, p_player_mins, p_player_maxs));
RETURN_META(mswi(lastFmRes));
}
void CreateBaseline_post(int player, int eindex, struct entity_state_s *baseline, struct edict_s *entity, int playermodelindex, vec3_t player_mins, vec3_t player_maxs)
{
g_es_hook = baseline;
PREPARE_VECTOR(player_mins);
PREPARE_VECTOR(player_maxs);
FM_ENG_HANDLE_POST(FM_CreateBaseline, (EnginePost[FM_CreateBaseline].at(i), (cell)player, (cell)eindex, (cell)baseline, (cell)ENTINDEX(entity), (cell)playermodelindex, p_player_mins, p_player_maxs));
RETURN_META(MRES_IGNORED);
}
// pfnCmdEnd
SIMPLE_VOID_HOOK_CONSTEDICT(CmdEnd);
@ -1399,6 +1432,14 @@ static cell AMX_NATIVE_CALL register_forward(AMX *amx, cell *params)
fId = MF_RegisterSPForwardByName(amx, funcname, FP_CELL, FP_DONE);
DLLHOOK(CmdEnd);
break;
case FM_CreateInstancedBaseline:
fId = MF_RegisterSPForwardByName(amx, funcname, FP_CELL, FP_CELL, FP_DONE);
ENGHOOK(CreateInstancedBaseline);
break;
case FM_CreateBaseline:
fId = MF_RegisterSPForwardByName(amx, funcname, FP_CELL, FP_CELL, FP_CELL, FP_CELL, FP_CELL, FP_ARRAY, FP_ARRAY, FP_DONE);
DLLHOOK(CreateBaseline);
break;
#if 0
// I know this does not fit with DLLFUNC(), but I dont want another native just for it.