mirror of
https://github.com/alliedmodders/amxmodx.git
synced 2024-12-25 14:25:38 +03:00
Add client_cmdStart forward (bug 5779, r=me)
This commit is contained in:
parent
1aae4c3ec5
commit
785ce1ea81
@ -35,6 +35,7 @@ void OnAmxxAttach()
|
|||||||
PlayerPostThinkForward = 0;
|
PlayerPostThinkForward = 0;
|
||||||
ClientKillForward = 0;
|
ClientKillForward = 0;
|
||||||
ClientImpulseForward = 0;
|
ClientImpulseForward = 0;
|
||||||
|
CmdStartForward = 0;
|
||||||
StartFrameForward = 0;
|
StartFrameForward = 0;
|
||||||
MF_AddNatives(ent_Natives);
|
MF_AddNatives(ent_Natives);
|
||||||
MF_AddNewNatives(ent_NewNatives);
|
MF_AddNewNatives(ent_NewNatives);
|
||||||
@ -55,6 +56,7 @@ void OnPluginsLoaded()
|
|||||||
PlayerPostThinkForward = MF_RegisterForward("client_PostThink", ET_STOP, FP_CELL, FP_DONE); // done
|
PlayerPostThinkForward = MF_RegisterForward("client_PostThink", ET_STOP, FP_CELL, FP_DONE); // done
|
||||||
ClientKillForward = MF_RegisterForward("client_kill", ET_STOP, FP_CELL, FP_DONE); // done
|
ClientKillForward = MF_RegisterForward("client_kill", ET_STOP, FP_CELL, FP_DONE); // done
|
||||||
ClientImpulseForward = MF_RegisterForward("client_impulse", ET_STOP, FP_CELL, FP_CELL, FP_DONE); // done
|
ClientImpulseForward = MF_RegisterForward("client_impulse", ET_STOP, FP_CELL, FP_CELL, FP_DONE); // done
|
||||||
|
CmdStartForward = MF_RegisterForward("client_cmdStart", ET_STOP, FP_CELL, FP_DONE); // done
|
||||||
StartFrameForward = MF_RegisterForward("server_frame", ET_IGNORE, FP_DONE); // done
|
StartFrameForward = MF_RegisterForward("server_frame", ET_IGNORE, FP_DONE); // done
|
||||||
DispatchKeyForward = MF_RegisterForward("pfn_keyvalue", ET_STOP, FP_CELL, FP_DONE); // done
|
DispatchKeyForward = MF_RegisterForward("pfn_keyvalue", ET_STOP, FP_CELL, FP_DONE); // done
|
||||||
PlaybackForward = MF_RegisterForward("pfn_playbackevent", ET_STOP, FP_CELL, FP_CELL, FP_CELL, FP_FLOAT, FP_ARRAY, FP_ARRAY, FP_FLOAT, FP_FLOAT, FP_CELL, FP_CELL, FP_CELL, FP_CELL, FP_DONE); // done
|
PlaybackForward = MF_RegisterForward("pfn_playbackevent", ET_STOP, FP_CELL, FP_CELL, FP_CELL, FP_FLOAT, FP_ARRAY, FP_ARRAY, FP_FLOAT, FP_FLOAT, FP_CELL, FP_CELL, FP_CELL, FP_CELL, FP_DONE); // done
|
||||||
@ -92,8 +94,8 @@ void OnPluginsLoaded()
|
|||||||
if (CheckForPublic("client_kill"))
|
if (CheckForPublic("client_kill"))
|
||||||
g_pFunctionTable->pfnClientKill=ClientKill;
|
g_pFunctionTable->pfnClientKill=ClientKill;
|
||||||
|
|
||||||
g_pFunctionTable->pfnCmdStart=NULL; // "client_impulse","register_impulse"
|
g_pFunctionTable->pfnCmdStart=NULL; // "client_impulse","register_impulse","client_cmdStart"
|
||||||
if (CheckForPublic("client_impulse"))
|
if (CheckForPublic("client_impulse") || CheckForPublic("client_cmdStart"))
|
||||||
g_pFunctionTable->pfnCmdStart=CmdStart;
|
g_pFunctionTable->pfnCmdStart=CmdStart;
|
||||||
|
|
||||||
g_pFunctionTable->pfnThink=NULL; // "pfn_think", "register_think"
|
g_pFunctionTable->pfnThink=NULL; // "pfn_think", "register_think"
|
||||||
|
@ -28,6 +28,7 @@ extern int PlayerPreThinkForward;
|
|||||||
extern int PlayerPostThinkForward;
|
extern int PlayerPostThinkForward;
|
||||||
extern int ClientKillForward;
|
extern int ClientKillForward;
|
||||||
extern int ClientImpulseForward;
|
extern int ClientImpulseForward;
|
||||||
|
extern int CmdStartForward;
|
||||||
extern int StartFrameForward;
|
extern int StartFrameForward;
|
||||||
extern int DispatchUseForward;
|
extern int DispatchUseForward;
|
||||||
extern int VexdTouchForward;
|
extern int VexdTouchForward;
|
||||||
|
@ -11,6 +11,7 @@ int PlayerPreThinkForward = 0;
|
|||||||
int PlayerPostThinkForward = 0;
|
int PlayerPostThinkForward = 0;
|
||||||
int ClientKillForward = 0;
|
int ClientKillForward = 0;
|
||||||
int ClientImpulseForward = 0;
|
int ClientImpulseForward = 0;
|
||||||
|
int CmdStartForward = 0;
|
||||||
int StartFrameForward = 0;
|
int StartFrameForward = 0;
|
||||||
int VexdTouchForward = 0;
|
int VexdTouchForward = 0;
|
||||||
int VexdServerForward = 0;
|
int VexdServerForward = 0;
|
||||||
@ -124,7 +125,6 @@ void CmdStart(const edict_t *player, const struct usercmd_s *_cmd, unsigned int
|
|||||||
int retVal = 0;
|
int retVal = 0;
|
||||||
edict_t *pEntity = (edict_t *)player;
|
edict_t *pEntity = (edict_t *)player;
|
||||||
g_cmd = (struct usercmd_s *)_cmd;
|
g_cmd = (struct usercmd_s *)_cmd;
|
||||||
META_RES res = MRES_IGNORED;
|
|
||||||
int origImpulse = g_cmd->impulse; // incase a plugin alters it
|
int origImpulse = g_cmd->impulse; // incase a plugin alters it
|
||||||
for (i=0; i<Impulses.size(); i++)
|
for (i=0; i<Impulses.size(); i++)
|
||||||
{
|
{
|
||||||
@ -139,6 +139,7 @@ void CmdStart(const edict_t *player, const struct usercmd_s *_cmd, unsigned int
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// client_impulse
|
||||||
if (ClientImpulseForward != -1 && origImpulse != 0)
|
if (ClientImpulseForward != -1 && origImpulse != 0)
|
||||||
{
|
{
|
||||||
retVal = MF_ExecuteForward(ClientImpulseForward, (cell)ENTINDEX(pEntity), (cell)origImpulse);
|
retVal = MF_ExecuteForward(ClientImpulseForward, (cell)ENTINDEX(pEntity), (cell)origImpulse);
|
||||||
@ -147,6 +148,17 @@ void CmdStart(const edict_t *player, const struct usercmd_s *_cmd, unsigned int
|
|||||||
g_cmd->impulse = 0;
|
g_cmd->impulse = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// client_CmdStart
|
||||||
|
if (CmdStartForward != -1)
|
||||||
|
{
|
||||||
|
incmd = true;
|
||||||
|
retVal = MF_ExecuteForward(CmdStartForward, (cell)ENTINDEX(pEntity));
|
||||||
|
incmd = false;
|
||||||
|
|
||||||
|
if (retVal)
|
||||||
|
RETURN_META(MRES_SUPERCEDE);
|
||||||
|
}
|
||||||
|
|
||||||
RETURN_META(MRES_IGNORED);
|
RETURN_META(MRES_IGNORED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -207,6 +207,9 @@ forward client_PostThink(id);
|
|||||||
/* Forward for impulses. */
|
/* Forward for impulses. */
|
||||||
forward client_impulse(id, impulse);
|
forward client_impulse(id, impulse);
|
||||||
|
|
||||||
|
/* Forward for CmdStart() on a player. */
|
||||||
|
forward client_cmdStart(id);
|
||||||
|
|
||||||
/* Called when an entity "thinks" (DispatchThink) */
|
/* Called when an entity "thinks" (DispatchThink) */
|
||||||
forward pfn_think(entid);
|
forward pfn_think(entid);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user