From b41a3631aa9a72a1dc804ceef4a4bd006e578ee8 Mon Sep 17 00:00:00 2001 From: Steve Dudenhoeffer Date: Thu, 12 Aug 2004 03:31:51 +0000 Subject: [PATCH] Updates on Null function table Renamed: - VelocityByAim->velocity_by_aim - RadiusDamage->radius_damage - PointContents->point_contents Backwards compatibility stocks will be included. Made precache_event a little bit more... logical. --- dlls/engine/amxxapi.cpp | 1 - dlls/engine/engine.cpp | 17 ++++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/dlls/engine/amxxapi.cpp b/dlls/engine/amxxapi.cpp index 4860d8d6..20742728 100755 --- a/dlls/engine/amxxapi.cpp +++ b/dlls/engine/amxxapi.cpp @@ -120,7 +120,6 @@ qboolean Voice_SetClientListening(int iReceiver, int iSender, qboolean bListen) int AddToFullPack(struct entity_state_s *state, int e, edict_t *ent, edict_t *host, int hostflags, int player, unsigned char *pSet) { - sprintf("%s called\n",__FUNCTION__); if(ent == host) { if(FStrEq(STRING(ent->v.classname), "player")) { if(plinfo[ENTINDEX(ent)].iViewType != CAMERA_NONE) { diff --git a/dlls/engine/engine.cpp b/dlls/engine/engine.cpp index 190dc156..6ada61a8 100755 --- a/dlls/engine/engine.cpp +++ b/dlls/engine/engine.cpp @@ -31,7 +31,7 @@ static cell AMX_NATIVE_CALL register_think(AMX *amx, cell *params) p->Class = new char[strlen(clsname)+1]; strcpy(p->Class, clsname); - p->Forward = MF_RegisterSPForwardByName(amx, MF_GetAmxString(amx, params[2], 0, &len), FP_CELL); + p->Forward = MF_RegisterSPForwardByName(amx, MF_GetAmxString(amx, params[2], 0, &len), FP_CELL, FP_DONE); Thinks.push_back(p); @@ -46,7 +46,7 @@ static cell AMX_NATIVE_CALL register_impulse(AMX *amx, cell *params) Impulse *p = new Impulse; p->Check = params[1]; - p->Forward = MF_RegisterSPForwardByName(amx, MF_GetAmxString(amx, params[2], 0, &len), FP_CELL); + p->Forward = MF_RegisterSPForwardByName(amx, MF_GetAmxString(amx, params[2], 0, &len), FP_CELL, FP_DONE); Impulses.push_back(p); @@ -76,7 +76,7 @@ static cell AMX_NATIVE_CALL register_touch(AMX *amx, cell *params) strcpy(p->Touched, Touched); } - p->Forward = MF_RegisterSPForwardByName(amx, MF_GetAmxString(amx, params[3], 2, &len), FP_CELL, FP_CELL); + p->Forward = MF_RegisterSPForwardByName(amx, MF_GetAmxString(amx, params[3], 2, &len), FP_CELL, FP_CELL, FP_DONE); Touches.push_back(p); @@ -355,9 +355,8 @@ static cell AMX_NATIVE_CALL precache_event(AMX *amx, cell *params) { int len; char *szEvent = MF_FormatAmxString(amx, params, 2, &len); - PRECACHE_EVENT(params[1], (char *)STRING(ALLOC_STRING(szEvent))); + return PRECACHE_EVENT(params[1], (char *)STRING(ALLOC_STRING(szEvent))); - return 1; } static cell AMX_NATIVE_CALL get_info_keybuffer(AMX *amx, cell *params) @@ -377,6 +376,7 @@ static cell AMX_NATIVE_CALL get_info_keybuffer(AMX *amx, cell *params) } //from jghg, who says it doesn't work +// it works, it's just a picky engine call -sawce static cell AMX_NATIVE_CALL drop_to_floor(AMX *amx, cell *params) { int iEnt = params[1]; @@ -449,8 +449,8 @@ static cell AMX_NATIVE_CALL set_view(AMX *amx, cell *params) { g_CameraCount--; if (g_CameraCount < 0) g_CameraCount=0; - if (g_CameraCount==0) - g_pFunctionTable->pfnAddToFullPack=AddToFullPack; + if (g_CameraCount==0) // Reset the AddToFullPack pointer if there's no more cameras in use... + g_pFunctionTable->pfnAddToFullPack=NULL; } plinfo[ENTINDEX(pPlayer)].iViewType = CAMERA_NONE; @@ -471,6 +471,7 @@ static cell AMX_NATIVE_CALL set_view(AMX *amx, cell *params) { } g_CameraCount++; g_pFunctionTable->pfnAddToFullPack=AddToFullPack; + g_pFunctionTable_Post->pfnPlayerPostThink=PlayerPostThink_Post; plinfo[ENTINDEX(pPlayer)].iRenderMode = pPlayer->v.rendermode; plinfo[ENTINDEX(pPlayer)].fRenderAmt = pPlayer->v.renderamt; @@ -502,6 +503,7 @@ static cell AMX_NATIVE_CALL set_view(AMX *amx, cell *params) { g_CameraCount++; g_pFunctionTable->pfnAddToFullPack=AddToFullPack; + g_pFunctionTable_Post->pfnPlayerPostThink=PlayerPostThink_Post; plinfo[ENTINDEX(pPlayer)].iRenderMode = pPlayer->v.rendermode; plinfo[ENTINDEX(pPlayer)].fRenderAmt = pPlayer->v.renderamt; @@ -533,6 +535,7 @@ static cell AMX_NATIVE_CALL set_view(AMX *amx, cell *params) { g_CameraCount++; g_pFunctionTable->pfnAddToFullPack=AddToFullPack; + g_pFunctionTable_Post->pfnPlayerPostThink=PlayerPostThink_Post; plinfo[ENTINDEX(pPlayer)].iRenderMode = pPlayer->v.rendermode; plinfo[ENTINDEX(pPlayer)].fRenderAmt = pPlayer->v.renderamt;