added cell list registering
This commit is contained in:
parent
a5819d8cf8
commit
28ede82f91
|
@ -480,6 +480,16 @@ void CForwardMngr::unregisterSPForward(int id)
|
|||
m_FreeSPForwards.push(id);
|
||||
}
|
||||
|
||||
int registerForwardC(const char *funcName, ForwardExecType et, cell *list, size_t num)
|
||||
{
|
||||
ForwardParam params[FORWARD_MAX_PARAMS];
|
||||
|
||||
for (size_t i=0; i<num; i++)
|
||||
params[i] = static_cast<ForwardParam>(list[i]);
|
||||
|
||||
return g_forwards.registerForward(funcName, et, num, params);
|
||||
}
|
||||
|
||||
int registerForward(const char *funcName, ForwardExecType et, ...)
|
||||
{
|
||||
int curParam = 0;
|
||||
|
@ -509,6 +519,16 @@ int registerForward(const char *funcName, ForwardExecType et, ...)
|
|||
return g_forwards.registerForward(funcName, et, curParam, params);
|
||||
}
|
||||
|
||||
int registerSPForwardByNameC(AMX *amx, const char *funcName, cell *list, size_t num)
|
||||
{
|
||||
ForwardParam params[FORWARD_MAX_PARAMS];
|
||||
|
||||
for (size_t i=0; i<num; i++)
|
||||
params[i] = static_cast<ForwardParam>(list[i]);
|
||||
|
||||
return g_forwards.registerSPForward(funcName, amx, num, params);
|
||||
}
|
||||
|
||||
int registerSPForwardByName(AMX *amx, const char *funcName, ...)
|
||||
{
|
||||
int curParam = 0;
|
||||
|
|
|
@ -46,6 +46,7 @@
|
|||
#ifndef FORWARD_H
|
||||
#define FORWARD_H
|
||||
|
||||
#include <stdarg.h>
|
||||
#include "sh_stack.h"
|
||||
|
||||
const int FORWARD_MAX_PARAMS = 32;
|
||||
|
@ -213,7 +214,9 @@ public:
|
|||
|
||||
// (un)register forward
|
||||
int registerForward(const char *funcName, ForwardExecType et, ...);
|
||||
int registerForwardC(const char *funcName, ForwardExecType et, cell *list, size_t num);
|
||||
int registerSPForwardByName(AMX *amx, const char *funcName, ...);
|
||||
int registerSPForwardByNameC(AMX *amx, const char *funcName, cell *list, size_t num);
|
||||
int registerSPForward(AMX *amx, int func, ...);
|
||||
void unregisterSPForward(int id);
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user